<%@page import="org.hibernate.validator.constraints.SafeHtml.Tag"%>
<%@ page import="cn.fl.framework.base.context.CurrentThreadContext" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN" >
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="renderer" content="webkit">
	<c:set var="ctx" value="${pageContext.request.contextPath}" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>项目产品详情</title>
	<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
	<div>
		<input id="prdmarks" value="" style="display:none"/>
		<div id="pageInTab" class="pageInTab">
			<form id="basePrdForm1">
				<div tabid="tabA" title="产品基本信息" lselected="true">
					<div class="fieldset1 tabel_col clearFix">
						<div class="caption">
							<span class="title">主车配置</span>
						</div>
						<div style="display: none">
							<input name="mfrId" id="mfrId" type="text"  value=""  class="ui-textbox"  disabled="disabled">
							<input name="mfrNm" id="mfrNm" type="text"  value=""  class="ui-textbox"  disabled="disabled">
							<input name="brCd" id="brCd" type="text"  value=""  class="ui-textbox"  disabled="disabled">
							<input name="prdbscInfoId" id="prdbscInfoId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
							<input name="carId" id="carId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
							<input name="tkId" id="tkId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
							<input name="prdId" id="prdId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
							<input name="prdDtlId" id="prdDtlId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
							<input name="removeFlag" id="removeFlag"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
							<input name="styleId" id="styleId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
                            <input name="carSourceId" id="carSourceId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">


						</div>
						<div class="fieldBox col_33" >
							<div class="label">产品名称</div>
							<div class="field">
								<input name="prdNm"  id="prdNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
							</div>
						</div>
						<div class="fieldBox col_33" >
							<div class="label">产品类型</div>
							<div class="field">
								<input name="prdTypCdNm" id="prdTypCdNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
								<input name="prdTypCd" id="prdTypCd" type="hidden"  value=""  class="ui-textbox"  >
								<input name="prdCd" id="prdCd" type="hidden"  value=""  class="ui-textbox"  >
							</div>
						</div>


						<div class="fieldBox col_33" >
							<div class="label">车辆型号</div>
							<div class="field">
								<input name="prdMdl" id="prdMdl" type="text"  value=""  class="ui-textbox" readonly="readonly">
							</div>
						</div>
						<div class="fieldBox col_66" >
							<div class="label">车型名称</div>
							<div class="field">
								<input name="carStyleName" id="carStyleName" type="text"  value="${prdBscInfoVO.carStyleName }"  class="ui-textbox"  readonly="readonly">
							</div>
						</div>
						<div class="fieldBox col_33" id="isTk">
							<div class="label">车型</div>
							<div class="field">
								<input name="prdMdlSun" id="prdMdlSun" type="text"  value=""  class="ui-textbox" readonly="readonly">
							</div>
						</div>

						<div class="fieldBox col_33" >
							<div class="label">产品品牌</div>
							<div class="field">
								<input name="brCdNm" id="brCdNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
							</div>
						</div>
						<div class="fieldBox col_33" >
							<div class="label">车系</div>
							<div class="field">
								<input name="modelNm" id="modelNm" type="text"  value="${prdBscInfoVO.modelNm }"  class="ui-textbox"  readonly="readonly">
							</div>
						</div>
						<div class="fieldBox col_33" >
							<div class="label">生产集团</div>
							<div class="field">
								<input name="productionCompany" id="productionCompany" type="text"  value=""  class="ui-textbox"  readonly="readonly">
							</div>
						</div>
						<div id="tkOption" style ="display: none">
							<div class="fieldBox col_33">
								<div class="label">品牌类别</div>
								<div class="field">
									<select id="brTypCd" name="brTypCd" readonly="readonly">
										<c:forEach items="${brTypCdList}" var="brType">
											<option value="${brType.key }">${brType.value }</option>
										</c:forEach>
									</select>
								</div>
							</div>

						</div>
						<div class="fieldBox col_33"  id="licenseCdDiv"  style="display: none">
							<div class="label">牌照类别</div>
							<div class="field">
								<select id="licenseCd" name="licenseCd" readonly="readonly">
									<c:forEach items="${licenseCdList}" var="license">
										<option value="${license.key }">${license.value }</option>
									</c:forEach>
								</select>
								<span class="requiredSymbol"  id="licenseCdTxt" style="display: none">*</span>
							</div>
						</div>

						<jsp:include page="../prjprdbscinfo/projectPrdBscInfoAddDynamicPage.jsp"></jsp:include>
						<div class="fieldBox col_33">
							<div class="label">是否新产品</div>
							<div class="field">
								<select id="isNew" name="isNew" onchange="setUsedPdShow()">
									<c:forEach items="${yesNoCdList}" var="yesFlag">
										<option value="${yesFlag.key }">${yesFlag.value }</option>
									</c:forEach>
								</select>
							</div>
						</div>
						<c:if test="${buOrgCd == '00000013' && prjTypCd=='CPYW'}">
							<div class="fieldBox col_33">
								<div class="label">是否预上牌</div>
								<div class="field">
									<select name="isAdvLic" id="isAdvLic" data-value=" " validate="{required:true}"  onchange="setAdvLicTmShow()">
										<option value=" " selected="selected">--请选择--</option>
										<option value="1" <c:if test="${prdBscInfoVO.isAdvLic == 1}">selected</c:if>>是</option>
										<option value="0" <c:if test="${prdBscInfoVO.isAdvLic == 0}">selected</c:if>>否</option>
									</select>
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_33" id="advLicTmDiv">
								<div class="label">预上牌时间</div>
								<div class="field">
									<input name="advLicTm" id="advLicTm" type="text" class="ui-datepicker" value="" >
									<span class="requiredSymbol">*</span>
								</div>
							</div>
						</c:if>
						<!-- <div  id="usedPdDiv" class="fieldBox col_33" style="display:none">
                         <div class="label">车辆已使用期限</div>
                         <div class="field">
                             <select  id="secUsedPd" name="secUsedPd" >
                                 <option value="0" selected="selected">0个月</option>
                             </select>
                         </div>
                     </div> -->
						<!-- 二手设备附加项 -->
						<div class="fieldBox col_100">
							<span style="color: red; display: none" id="SecondPrdText" >二手设备附加项</span>
						</div>
						<div id="SecondPrd"  style="display: none">
							<jsp:include page="../prjprdbscinfo/projectPrdBscInfoAddSecDynamicPage.jsp"></jsp:include>
                            <div class="fieldBox col_33" >
                                <div class="label">变速箱品牌</div>
                                <div class="field">
                                    <input name="gerrBoxBrand" id="gerrBoxBrand" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>

                            <div class="fieldBox col_33" >
                                <div class="label">发动机品牌</div>
                                <div class="field">
                                    <input name="styleEngine" id="styleEngine" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>

                            <div class="fieldBox col_33" >
                                <div class="label">出厂日期</div>
                                <div class="field">
                                    <input name="releaseDate" id="releaseDate" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>

                            <div class="fieldBox col_33" >
                                <div class="label">车辆停放地</div>
                                <div class="field">
                                    <input name="parkingLot" id="parkingLot" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>

                            <div class="fieldBox col_33" >
                                <div class="label">车辆等级</div>
                                <div class="field">
                                    <input name="classNm" id="classNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>
                            <%--
                            <div class="fieldBox col_33" >
                                <div class="label">验车方式</div>
                                <div class="field">
                                    <input name="vehCheckCode" id="vehCheckCode" type="hidden"  value="" style="display: none" class="ui-textbox"  readonly="readonly">
                                    <input name="vehCheckCodeNm" id="vehCheckCodeNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>--%>

                            <div class="fieldBox col_33" >
                                <div class="label">评估师</div>
                                <div class="field">
                                    <input name="surveyorNm" id="surveyorNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>

                            <div class="fieldBox col_33" >
                                <div class="label">车源网估值</div>
                                <div class="field">
                                    <input name="vehValNew" id="vehValNew" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>
                            <div class="fieldBox col_33" >
                                <div class="label">估值时间差</div>
                                <div class="field">
                                    <input name="timeDiff" id="timeDiff" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>
                            <div class="fieldBox col_33" >
                            <div class="label">浮动比例</div>
                            <div class="field">
                                <input name="floatPct" id="floatPct" type="text"  value="0"  class="ui-textbox"  readonly="readonly">
                            </div>
                        </div>
                            <div class="fieldBox col_33" >
                                <div class="label">车源编号</div>
                                <div class="field">
                                    <input name="carNo" id="carNo" type="text"  value=""  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div>
							<div class="fieldBox col_33" >
								<div class="label">可贷金额</div>
								<div class="field">
									<input name="loanableAmt" id="loanableAmt" type="text"  value=""  class="ui-textbox"  readonly="readonly">
								</div>
							</div>
							<c:if test="${isShowPdfFilepath != false}">
								<div class="fieldBox col_33" >
									<div class="label">车辆评估检测报告</div>
									<div class="field">
										<c:if test="${pdfFilepath != null && pdfFilepath != ''}">
											<a href="${pdfFilepath}" class="link" target="_blank">
												<span>查看报告</span>
											</a>
										</c:if>
										<c:if test="${pdfFilepath == null || pdfFilepath == ''}">
											<a href="javascript:toPdfFilepath()" class="link">
												<span>查看报告</span>
											</a>
										</c:if>
									</div>
								</div>
							</c:if>
							<div class="fieldBox col_33" >
								<div class="label">行驶里程</div>
								<div class="field">
									<input name="tvlMil" id="tvlMil" type="text"  value=""  class="ui-textbox"  readonly="readonly">
								</div>
							</div>
                            <c:if test="${isDetail==0}">
								<c:if test="${prjTypCd =='CDDYWUL' || prjTypCd =='ESCJYD' || prjTypCd =='OWNJYD'}">
									<div class="fieldset1 clearFix">
										<div class="btnsBox" style="text-align: center;">
											<span id="saveEscBtn" class="sq-button sq-button-round" onclick="saveEscInfoBtn()">保存二手设备附加项信息</span>
										</div>
									</div>
								</c:if>
                            </c:if>
						</div>
						<div class="caption" >
							<span class="title">上装配置</span>
						</div>
						<jsp:include page="../prjprdbscinfo/projectPrdDetailDynamicPage.jsp"></jsp:include>
						<div class="caption">
							<span class="title">项目相关信息</span>
						</div>
						<c:if test="${prjTypCd != 'CDDYWYQ'}">
							<div class="fieldBox col_33">
								<div class="label">参考价（元）</div>
								<div class="field">
									<c:if test="${fromCddFlag==1 }">
										<input id="guidePc" name="guidePc" type="text"  class="ui-textbox"  value="${prdBscInfoVO.guidePc }"   onchange="guidePcChange()" validate="{number: true,required:true}"/>
									</c:if>
									<c:if test="${fromCddFlag!=1 }">
										<input id="guidePc" name="guidePc" type="text"  class="ui-textbox"  value=""   onchange="guidePcChange()" validate="{number: true,required:true}"/>
									</c:if>
									<span class="requiredSymbol">*</span>
								</div>
							</div>
						</c:if>
						<c:if test="${prjTypCd == 'CDDYWYQ'}">
							<div class="fieldBox col_33" aria-readonly="true">
								<div class="label">参考价（元）</div>
								<div class="field" aria-readonly="true">
									<c:if test="${fromCddFlag==1 }">
										<input id="guidePc" name="guidePc" type="text"  class="ui-textbox"  value="${prdBscInfoVO.guidePc }"   onchange="guidePcChange()" validate="{number: true,required:true}" readonly/>
									</c:if>
									<c:if test="${fromCddFlag!=1 }">
										<input id="guidePc" name="guidePc" type="text"  class="ui-textbox"  value=""   onchange="guidePcChange()" validate="{number: true,required:true}" readonly/>
									</c:if>
									<span class="requiredSymbol">*</span>
								</div>
							</div>
						</c:if>
						<div class="fieldBox col_33">
							<div class="label">数量</div>
							<div class="field">
								<input id="prdQty" name="prdQty" type="text"  class="ui-textbox"  value="${prdQty}" onchange="guidePcChange()" validate="{number: true,required:true}"/>
								<span class="requiredSymbol">*</span>
							</div>
						</div>
						<div class="fieldBox col_33">
							<div class="label">设备款合计（元）</div>
							<div class="field">
								<input id="prdAmt" name="prdAmt" type="text"  class="ui-textbox"  value="" readonly="readonly"/>
							</div>
						</div>
						<div class="fieldBox col_100"  id="guideMsgDiv" style="display: none">
							<div class="label">注意事项：</div>
							<div class="field">
								<span style="color: red"> 包牌项目请在参考价填入包牌价格</span>
							</div>
						</div>
						<div class="fieldBox col_33">
							<div class="label">每台设备留购价（元）</div>
							<div class="field">
								<c:if test="${prjTypCd != 'CDDYWYQ'}">
									<input id="rsrvPc" name="rsrvPc" type="text" onblur="checkAmt();" class="ui-textbox"  value="" validate="{number: true,required:true}"/>
								</c:if>
								<c:if test="${prjTypCd == 'CDDYWYQ'}">
									<input id="rsrvPc" name="rsrvPc" type="text" class="ui-textbox"  value="0" validate="{number: true,required:true}" readonly/>
								</c:if>
								<span class="requiredSymbol">*</span>
							</div>
						</div>
                        <div class="fieldBox col_33" id="vehValDiv" style="display: none">
                            <div class="label">车辆估值(元)</div>
                            <div class="field">
								<input id="vehVal" name="vehVal" type="text"  disabled="disabled"  class="ui-textbox"  value="" />
								<span class="requiredSymbol">*</span>
                            </div>
                        </div>

                        <div class="fieldBox col_33"   id="custFinaDiv" style="display: none">
                            <div class="label">客户融资金额</div>
                            <div class="field">
                                <input id="custFina" name="custFina" type="text"    class="ui-textbox"  value="" />
                                <c:if test="${prjTypCd == 'CDDYWUL'}">
                                    <span class="requiredSymbol">*</span>
                                </c:if>
                            </div>
                        </div>
						<div class="fieldBox col_33" id="irrPctText">
							<div class="label">实际收益率</div>
							<div class="field">
								<input id="irrPct" name="irrPct" type="text"  class="ui-textbox"  value="" validate="{number: true}"/>%
							</div>
						</div>
                        <c:if test="${prjTypCd != 'CDDYWYQ'}">
                            <div class="fieldBox col_33">
                                <div class="label">收款方类型</div>
                                <div class="field">
                                    <select id="receiveTypeCd" name="receiveTypeCd">
                                        <c:forEach items="${receiveTypeCdList}" var="rtc">
                                            <option value="${rtc.key }">${rtc.value }</option>
                                        </c:forEach>
                                    </select>
                                    <span class="requiredSymbol">*</span>
                                </div>
                            </div>
                        </c:if>
                        <c:if test="${prjTypCd == 'CDDYWYQ'}">
                            <div class="fieldBox col_33">
                                <div class="label">收款方类型</div>
                                <div class="field">
                                    <span>承租人</span>
                                    <span class="requiredSymbol">*</span>
                                </div>
                            </div>
                        </c:if>
                        <c:if test="${prjTypCd != 'CDDYWYQ'}">
                            <div class="fieldBox col_50" id="splOwner">
                                <div class="label">收款方</div>
                                <div class="field">
                                    <input name="splId"  id="splId"  type="text"  value="" placeholder="请选择"   onchange="getSplAccNos();"  ltype="combobox">
                                    <span class="requiredSymbol">*</span>
                                    <%--<span id="addBtnSpl" class="sq-button sq-button-round" style="margin-left:22px" onclick="addSpl()">新增</span>--%>
                                    <div class="combo_itemList_wrap"></div>
                                </div>
                            </div>
                            <div class="fieldBox col_50" id="cstOwner" style="display: none">
                                <div class="label">收款方</div>
                                <div class="field">
                                    <input name="cstSplId"  id="cstSplId"  type="text"  value="" placeholder="请选择"   onchangme="getCstSplAccNos();"  ltype="combobox">
                                    <span class="requiredSymbol">*</span>
                                    <%--<span id="addBtnSpl" class="sq-button sq-button-round" style="margin-left:22px" onclick="addSpl()">新增</span>--%>
                                    <div class="combo_itemList_wrap"></div>
                                </div>
                            </div>
                        </c:if>
                        <c:if test="${prjTypCd == 'CDDYWYQ'}">
                            <div class="fieldBox col_50" id="splOwner">
                                <div class="label">收款方</div>
                                <div class="field">
                                    <select id="yqCstSplId" name="yqCstSplId">
                                        <c:forEach items="${yqCstIdList}" var="yqCstIdList">
                                            <option value="${yqCstIdList.cstId}">${yqCstIdList.cstNm}</option>
                                        </c:forEach>
                                    </select>
                                    <span class="requiredSymbol">*</span>
                                </div>
                            </div>
                        </c:if>
						<!-- 供应商ID -->
                        <c:if test="${prjTypCd != 'CDDYWYQ'}">
                            <div class="fieldBox col_50" id="splAccNo">
                                <div class="label">收款账号</div>
                                <div class="field">
                                    <input name="splAccNoId"  id="splAccNoId"  type="text"  value="" placeholder="请选择"  onclick=""  ltype="combobox">
                                    <span class="requiredSymbol">*</span>
                                    <span id="addBtnSplAccNo" class="sq-button sq-button-round" style="margin-left:22px" onclick="addSplAccNo()">新增</span>
                                    <div class="combo_itemList_wrap"></div>
                                </div>
                            </div>
                            <div class="fieldBox col_50" id="cstAccNo" style="display: none">
                                <div class="label">收款账号</div>
                                <div class="field">
                                    <input name="cstSplAccNoId"  id="cstSplAccNoId"  type="text"  value="" placeholder="请选择"  onclick="getCstBankInfoList();"  ltype="combobox">
                                    <span class="requiredSymbol">*</span>
                                    <div class="combo_itemList_wrap"></div>
                                </div>
                            </div>
                        </c:if>
                        <c:if test="${prjTypCd == 'CDDYWYQ'}">
                            <div class="fieldBox col_50" id="splAccNo">
                                <div class="label">收款账号</div>
                                <div class="field">
                                    <select id="yqSplAccNoId" name="yqSplAccNoId">
                                        <c:forEach items="${yqAccNoList}" var="yqAccNoList">
										<option <c:if test="${yqBankId == yqAccNoList.key}" >selected</c:if>
													value="${yqAccNoList.key}">${yqAccNoList.value}</option>
                                        </c:forEach>
                                    </select>
                                    <span class="requiredSymbol">*</span>
                                </div>
                            </div>
                        </c:if>
						<!-- 供应商厂商信息 -->
						<c:if test="${(prjTypCd=='CPYW' && isSplMfr == 1) || (prjTypCd=='CTYW' && isSplMfr == 1) || (prjTypCd=='DSFZGCT' && isSplMfr == 1) || (prjTypCd=='DSFZGCP' && isSplMfr == 1)}">
							<div class="fieldBox col_100">
								<div class="label">厂商</div>
								<div class="field">
									<input name="splMfrId"  id="splMfrId"  type="text"  value="" placeholder="请选择" ltype="combobox">
									<span class="requiredSymbol">*</span>
									<div class="combo_itemList_wrap"></div>
								</div>
							</div>
						</c:if>
						<c:if test="${prjTypCd == 'CDDYWYQ'}">
							<div class="fieldBox col_50" id="isHaveBckNo">
								<div class="label">是否有供应商返利账号</div>
								<div class="field">
									<span>否</span>
								</div>
							</div>
						</c:if>
						<c:if test="${prjTypCd != 'CDDYWYQ'}">
							<div class="fieldBox col_50" id="isHaveBckNo" style="display: none">
								<div class="label">是否有供应商返利账号</div>
								<div class="field">
									<select id="isBckNo" name="isBckNo" onchange="setSplBackBankShow()">
										<option value="">--请选择--</option>
										<c:forEach items="${yesNoCdList}" var="yesFlag">
											<option value="${yesFlag.key }"
													<c:if test="${hasSplBackNo==yesFlag.key}">
														selected="selected"
													</c:if>
											>${yesFlag.value }</option>
										</c:forEach>
									</select>
								</div>
							</div>
						<!-- 供应商返利ID -->
							<div class="fieldBox col_50"  id="splBckBankAccDiv"  style="display: none">
								<div class="label">供应商返利账号</div>
								<div class="field">
									<input name="splBackBankNoId"  id="splBackBankNoId"  type="text"  value="" placeholder="请选择"  onclick="getSplBackBankNo();"  ltype="combobox"  >
									<span class="requiredSymbol" id="splBackBankValidate" style="display: none">*</span>
									<span id="addBtnSplBankAccNo" class="sq-button sq-button-round" style="margin-left:22px" onclick="addSplBackAccNo()">新增</span>
									<div class="combo_itemList_wrap"></div>
								</div>
							</div>
						</c:if>

						<div class="fieldBox col_50" id="isHaveSalBckNo" >
							<div class="label">是否有销售返利账号</div>
							<div class="field">
								<select id="isSalBckNo" name="isSalBckNo" onchange="setSalBackBankShow()">
									<option value="">--请选择--</option>
									<c:forEach items="${yesNoCdList}" var="yesFlag">
										<option value="${yesFlag.key }"
												<c:if test="${hasSalBackNo==yesFlag.key}">
													selected="selected"
												</c:if>
										>${yesFlag.value }</option>
									</c:forEach>
								</select>
							</div>
						</div>
						<!-- 供应商销售返利ID -->
						<c:if test="${prjTypCd != 'CDDYWYQ'}">
							<div class="fieldBox col_50"  id="salBckBankAccDiv"  style="display: none">
								<div class="label">销售返利账号</div>
								<div class="field">
									<input name="salBackBankNoId"  id="salBackBankNoId"  type="text"  value="" placeholder="请选择"  onclick="getSalBackBankNo();"  ltype="combobox"  >
									<span class="requiredSymbol" id="salBackBankValidate" style="display: none">*</span>
									<span id="addBtnSalBackAccNo" class="sq-button sq-button-round" style="margin-left:22px" onclick="addSalBackAccNo()">新增</span>
									<div class="combo_itemList_wrap"></div>
								</div>
							</div>
						</c:if>
						<div class="fieldBox col_100"  id="msgDiv" style="display: none">
							<div class="label">注意事项：</div>
							<div class="field">
								<span style="color: red">销售返利投放后存在无法撤回风险，请在选择收款方账号信息时注意账号选择是否正确！若因账号选择或维护错误导致付错款，业务经理自行承担返利损失！</span>
							</div>
						</div>
						<c:if test="${buOrgCd =='00000001'}">
							<div class="fieldBox col_50" id="recommendSplOwner">
								<div class="label">推荐经销商</div>
								<div class="field">
									<input name="recommendSplId"  id="recommendSplId"  type="text"  value="" placeholder="请选择" ltype="combobox">
									<span class="requiredSymbol">*</span>
										<%--<span id="addBtnSpl" class="sq-button sq-button-round" style="margin-left:22px" onclick="addSpl()">新增</span>--%>
									<div class="combo_itemList_wrap"></div>
								</div>
							</div>
						</c:if>

						<c:if test="${buOrgCd =='00000001' and (prjTypCd =='CTYW' || prjTypCd =='CPYW')}">
							<div class="caption">
								<span class="title">挂靠信息</span>
							</div>
							<div class="fieldBox col_50">
								<div class="label">挂靠类型:</div>
								<div class="field">
								<c:if test="${prjPrdDtlVO.lnkCompType != '' and prjPrdDtlVO.lnkCompType != null}">
									<input type="radio" name="lnkCompType" value="1" ${prjPrdDtlVO.lnkCompType =='1'?'checked':''} >公户</input>
									<input type="radio" name="lnkCompType" value="2" ${prjPrdDtlVO.lnkCompType =='2'?'checked':''}>个人户</input>
								</c:if>
								<c:if test="${prjPrdDtlVO.lnkCompType == '' or prjPrdDtlVO.lnkCompType == null}">
									<input type="radio" name="lnkCompType" value="1" checked>公户</input>
									<input type="radio" name="lnkCompType" value="2" >个人户</input>
								</c:if>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">挂靠公司:</div>
								<div class="field">
									<input type="input" name="lnkCompNm" id="lnkCompNm" class="ui-textbox" value="${prjPrdDtlVO.lnkCompNm}" onclick="selectLnkComp();"></input>
									<input type="hidden" name="lnkCompId" id="lnkCompId" class="ui-textbox" value="${prjPrdDtlVO.lnkCompId}"></input>
									<input type="hidden" name="lnkStartLvl" id="lnkStartLvl" class="ui-textbox" value="${prjPrdDtlVO.lnkStartLvl==null?'':prjPrdDtlVO.lnkStartLvl}"></input>
									<input type="hidden" name="lnkCompMsg" id="lnkCompMsg" class="ui-textbox" value="${prjPrdDtlVO.lnkCompMsg==null?'':prjPrdDtlVO.lnkCompMsg}"></input>
								</div>
							</div>
							<div id="message">
								<font color="red">注意：项目中挂靠公司必须唯一，如挂靠公司不唯一，请拆分立项</font>
							</div>
						</c:if>

						<div id ="guaranteePaymentInfo" style="display: none">
							<div class="caption">
								<span class="title">担保主体信息</span>
							</div>
							<div class="fieldBox col_50" id="guaranteePaymentTypeOwner">
								<div class="label">渠道担保支付主体</div>
								<div class="field">
									<select id="guaranteePaymentType" name="guaranteePaymentType" onchange="getGuaranteePaymentInfo(this.value)">
										<c:forEach items="${guaranteePaymentTypeList}" var="rtc">
											<option value="${rtc.key }" >${rtc.value } </option>
										</c:forEach>
									</select>
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50" id="guaranteePaymentIdOwner">
								<div class="label">担保主体名称</div>
								<div class="field">
									<input name="guaranteePaymentId"  id="guaranteePaymentId"  type="text"  value=""  onchange="getGuaranteeAccNoInfo()" placeholder="请选择" ltype="combobox">
									<span class="requiredSymbol">*</span>
									<%--<span id="addBtnSpl" class="sq-button sq-button-round" style="margin-left:22px" onclick="addSpl()">新增</span>--%>
									<div class="combo_itemList_wrap"></div>
								</div>
							</div>
						</div>
						<div id ="compensatorySplInfo" style="display: none">
							<div class="caption">
								<span class="title">代偿担保账号信息</span>
							</div>
							<div class="fieldBox col_50" id="compensatorySplAccNo">
								<div class="label">支付账号</div>
								<div class="field">
									<input name="compensatorySplAccNoId"  id="compensatorySplAccNoId"  type="text"  value="" placeholder="请选择"  onclick=""  ltype="combobox">
									<span class="requiredSymbol">*</span>
									<div class="combo_itemList_wrap"></div>
								</div>
							</div>
							<div class="fieldBox col_33">
								<div class="label">支付账户</div>
								<div class="field">
									<input name="compensatorySplRcptUnt"  id="compensatorySplRcptUnt"  type="text"  value="${compensatorySplRcptUnt}" class="ui-textbox"  >
									<span class="requiredSymbol">*</span>
									<div class="combo_itemList_wrap"></div>
								</div>
							</div>
							<div class="fieldBox col_33">
								<div class="label">开户行</div>
								<div class="field">
									<input name="compensatorySplBkNm"  id="compensatorySplBkNm"  type="text"  value="${compensatorySplBkNm}" class="ui-textbox"  >
									<span class="requiredSymbol">*</span>
									<div class="combo_itemList_wrap"></div>
								</div>
							</div>
							<div class="fieldBox col_33">
								<div class="label">行号</div>
								<div class="field">
									<input name="compensatorySplBkNo"  id="compensatorySplBkNo"  type="text"  value="${compensatorySplBkNo}" class="ui-textbox"  >
									<span class="requiredSymbol">*</span>
									<div class="combo_itemList_wrap"></div>
								</div>
							</div>
						</div>
						<div id ="depositSplInfo" style="display: none">
							<div class="caption">
								<span class="title">保证金担保账号信息</span>
							</div>
							<div class="fieldBox col_50" id="depositSplAccNo">
								<div class="label">支付账号</div>
								<div class="field">
									<input name="depositSplAccNoId"  id="depositSplAccNoId"  type="text"  value="" placeholder="请选择"  onclick=""  ltype="combobox">
									<span class="requiredSymbol">*</span>
									<div class="combo_itemList_wrap"></div>
								</div>
							</div>
							<div class="fieldBox col_33">
								<div class="label">支付账户</div>
								<div class="field">
									<input name="depositSplRcptUnt"  id="depositSplRcptUnt"  type="text"  value="${depositSplRcptUnt}" class="ui-textbox"  >
									<span class="requiredSymbol">*</span>
									<div class="combo_itemList_wrap"></div>
								</div>
							</div>
							<div class="fieldBox col_33">
								<div class="label">开户行</div>
								<div class="field">
									<input name="depositSplBkNm"  id="depositSplBkNm"  type="text"  value="${depositSplBkNm}" class="ui-textbox"  >
									<span class="requiredSymbol">*</span>
									<div class="combo_itemList_wrap"></div>
								</div>
							</div>
							<div class="fieldBox col_33">
								<div class="label">行号</div>
								<div class="field">
									<input name="depositSplBkNo"  id="depositSplBkNo"  type="text"  value="${depositSplBkNo}" class="ui-textbox"  >
									<span class="requiredSymbol">*</span>
									<div class="combo_itemList_wrap"></div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</form>

			<div id="btnsBox" class="btnsBox">
                <span id="saveBtn" class="sq-button sq-button-round" onclick="savePrjBscInfo()"><!-- <i class="sqBtnIco_10"></i> -->保存</span>
                <span id="cancelBtn" class="sq-button sq-button-round" onclick="cancelBtn()"><!-- <i class="sqBtnIco_14"></i> -->取消</span>
                <c:if test="${isDetail==0}">
					<c:if test="${prjTypCd =='CDDYWUL' || prjTypCd =='ESCJYD' || prjTypCd =='OWNJYD'}">
						<div style="text-align:center">
							<span id="syncSourceDataBtn" class="sq-button sq-button-round" onclick="syncSourceDateInfo()">同步车源库车辆信息</span>
							<c:if test="${buOrgCd =='00000001'}">
								<span id="saveVehVal" class="sq-button sq-button-round" onclick="saveVehVal()">保存车辆估值</span>
							</c:if>
						</div>
					</c:if>
				</c:if>
			</div>
			</form>
		</div>
	</div>
</div>


<script type="text/javascript">
	var guidePcEditFlag = "${guidePcEditFlag}";//参考价是否可编辑标志 0-否,1-是
    var mfrGuidePcShowFlag = '${mfrGuidePcShowFlag}'; //产品明细页面厂商指导价展示标志 0-不展示,1-展示
    console.log("车辆参考价是否可编辑标志 >>" + guidePcEditFlag);
    console.log("厂商指导价展示标志 >>" + mfrGuidePcShowFlag);
    var prjId="${prjId}";
    var vehNo="${vehNo}";
    var prdDetailId="${prdDetailId}";
    var detailFlag = '${detailFlag}';
    var splBanNo = '${splBanNo}';
    var salBanNo = '${salBanNo}';
    var id="${id}";
    var beforePrdQty = '';
    var beforeGuidePc = '';
    var beforeRsrvPc = '';
    var beforeVehVal = '';
    var beforeCustFina = '';
	var searchSplNm = '';
	var bizCd = "${bizCd}";
	var buOrgCd = '${buOrgCd}';
	var prjTypCd = '${prjTypCd}';//项目类型
	var insCode = '${insCode}';//机构代码
	var hasSplBackNo = ${hasSplBackNo};
	var hasSalBackNo = ${hasSalBackNo};
	var hasBackNoFlag =  ${hasBackNoFlag};
	var _rcCstBscInfoId = '';
	var plcyTcode = '${plcyTcode}';
	var prdTypCd = '${prdTypCd}';
	var prdCd = '${prdCd}';//二级分类
	var hasAccNoFlag = ${hasAccNoFlag};
	var isSplMfr = '${isSplMfr}';
	var COMBO_BANK;
	var COMPENSATORY_COMBO_BANK;
	var DEPOSIT_COMBO_BANK;
	var insRoutePrdId='${insRoutePrdId}';
    var isDetail = '${isDetail}';
	var prjPrdChangeFlag = '${prjPrdChangeFlag}';
	var paySchId = '${paySchId}';
	var paySchNo = '${paySchNo}';
	var oldDtlId = '${oldDtlId}';
	var isCanEditRecommendSpl = '${isCanEditRecommendSpl}';
	$("#receiveTypeCd").val("${receiveTypeCd}");
	var isCanEditLnkCompInfo = '${isCanEditLnkCompInfo}';
	var isCanEditCompensatorySplInfo = '${isCanEditCompensatorySplInfo}';
	var isCanEditDepositSplInfo = '${isCanEditDepositSplInfo}';
	var compensatoryType = '${compensatoryType}';
	var guaranteePaymentType = '${guaranteePaymentType}'
	var insGuidPc = '${insGuidPc}';
	var insCustFina = '${insCustFina}';
	var cstTypeCd = '${cstTypeCd}';
	var splIdVal = '${splId}';
	var accIdVal='${accId}';
	console.log(accIdVal + "111");
	if (compensatoryType == '2' || compensatoryType == '1') {
		$('#guaranteePaymentInfo').show();
		$("#guaranteePaymentType").val(guaranteePaymentType);
	}
	/*  var wait_dialog_refresh_field = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" }); */
	$(function () {
		if (${prjTypCd == 'CDDYWYQ'}) {
			if(detailFlag=="true") {
				// 先空着保存和取消按钮
				$("#saveBtn").hide();
				$("#cancelBtn").hide();
				$("#basePrdForm1").attr("readOnly", true);
			}
			$("#prdQty").val("1");
			$("#prdQty").attr("readOnly", true);
		} else {
			getSplBankNo();
		}
		//getCstSplBankNo();
		initMfrComboBox();
		var basePrdForm1 = liger.get("basePrdForm1");
		var form = $("#basePrdForm1").ligerForm({
			validate: true
		});
		$("#basePrdForm1").check_ligerFormEditor();
		initData();

		//二手车车抵贷线下 收款方类型根据客户类型锁死
		if(buOrgCd === ProjectConstant.CODE_BU_ORG_CD_ZK && prjTypCd == ProjectConstant.PRJ_TYP_CD_CDDYWUL) {
			var selectid= $("#receiveTypeCd").ligerGetComboBoxManager();
			if(cstTypeCd == "1"){
				//承租人
				$("#receiveTypeCd").val("2");
			}else{
				//经销商
				$("#receiveTypeCd").val("1");
			}
			selectid.setValue($("#receiveTypeCd").val());
			selectid.setText($("#receiveTypeCd").find(":selected").text());
			liger.get("receiveTypeCd").setDisabled(true);
		}
		if(bizCd == "008001" || bizCd == "008004"){
			if(liger.get("carLen")&&liger.get("carLen")!="undefined"){
				liger.get("carLen").setDisabled(true);
			}
			if(liger.get("powerTypCd")&&liger.get("powerTypCd")!="undefined"){
				liger.get("powerTypCd").setDisabled(true);
			}
		}
		var receiveTypeCd = $("#receiveTypeCd").val();
		if(receiveTypeCd!=ProjectConstant.RECEIVE_TYPE_CD_SPL){//经销商
			getCstInfoList();
			getCstBankInfoList();
			$("#isBckNo").val('0');
			$("#splBackBankNoId").val("");
			$("#addBtnSplAccNo").hide();
			$("#splOwner").hide();
			$("#cstOwner").show();
			$("#splAccNo").hide();
			$("#cstAccNo").show();
			/*$("#splId").attr("validate", "");
			$("#cstSplId").attr("validate", "{required:true}");
			$("#splAccNoId").attr("validate", "");
			$("#cstSplAccNoId").attr("validate", "{required:true}");*/
		}else{
			$("#splOwner").show();
			$("#cstOwner").hide();
			$("#isHaveBckNo").show();
			$("#splAccNo").show();
			$("#cstAccNo").hide();
		}
        if(prjTypCd==ProjectConstant.CODE_PRJ_TYP_CD_ESC||prjTypCd==ProjectConstant.PRJ_TYP_CD_CDDYWUL||prjTypCd==ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd==ProjectConstant.PRJ_TYP_CD_OWNJYD){
            liger.get("isNew").setValue("0");
            //$("#isNew").val("0");
            //设置不可选
            var slt=liger.get("isNew");
            slt.setDisabled(true);
            setUsedPdShow();
            $("#isNew").hide();
        }
		//收款方类型
		$("#receiveTypeCd").change(function () {
			var receiveTypeCd = $("#receiveTypeCd").val();
			COMBO_CST.setInputValue("", "", true);
			if(receiveTypeCd!=ProjectConstant.RECEIVE_TYPE_CD_SPL){//经销商
				getCstInfoList();
				getCstBankInfoList();
				$("#isHaveBckNo").hide();
				$("#isBckNo").val('0');
				$("#splBackBankNoId").val("");
				$("#addBtnSplAccNo").hide();
				$("#splOwner").hide();
				$("#cstOwner").show();
				$("#splAccNo").hide();
				$("#cstAccNo").show();
				/*$("#splId").attr("validate", "");
				$("#cstSplId").attr("validate", "{required:true}");
				$("#splAccNoId").attr("validate", "");
				$("#cstSplAccNoId").attr("validate", "{required:true}");*/
			}else{
				$("#splOwner").show();
				$("#cstOwner").hide();
				$("#isHaveBckNo").show();
				$("#addBtnSplAccNo").show();
				$("#splAccNo").show();
				$("#cstAccNo").hide();
				/*$("#splId").attr("validate", "{required:true}");
				$("#cstSplId").attr("validate", "");
				$("#splAccNoId").attr("validate", "{required:true}");
				$("#cstSplAccNoId").attr("validate", "");*/
			}
		});

		//设置影响产品价格的字段为不可修改
		/* if(liger.get("prdMdl")&&liger.get("prdMdl")!="undefined"){
            liger.get("prdMdl").setDisabled(true);
        } */
		if(liger.get("emiStdCd")&&liger.get("emiStdCd")!="undefined"){
			liger.get("emiStdCd").setDisabled(true);
		}
		if(liger.get("prdClsCd")&&liger.get("prdClsCd")!="undefined"){
			liger.get("prdClsCd").setDisabled(true);
		}
		if(liger.get("drvTyp")&&liger.get("drvTyp")!="undefined"){
			liger.get("drvTyp").setDisabled(true);
		}
		if(liger.get("engMdl")&&liger.get("engMdl")!="undefined"){
			liger.get("engMdl").setDisabled(true);
		}

		if(liger.get("prdLvlCd")&&liger.get("prdLvlCd")!="undefined"){
			liger.get("prdLvlCd").setDisabled(true);
		}

		if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_CAR){
			//汽车金融事业部隐藏保险购买方式、实际收益率
			$("#irrPctText").hide();
			$("#buyWayCdText").hide();
		}else{
			$("#irrPctText").show();
			$("#buyWayCdText").show();
		}
		if(detailFlag=="true"){
			$("#saveBtn").hide();
			$("#cancelBtn").hide();
			$("#addBtnSpl").hide();
			$("#addBtnSplAccNo").hide();
			$("#addBtnSplBankAccNo").hide();
			$("#addBtnSalBackAccNo").hide();

            if(liger.get("prdMdl")&&liger.get("prdMdl")!="undefined"){
                liger.get("prdMdl").setDisabled(true);
            }
            if(liger.get("prdNm")&&liger.get("prdNm")!="undefined"){
                liger.get("prdNm").setDisabled(true);
            }
            if(liger.get("prdTypCdNm")&&liger.get("prdTypCdNm")!="undefined"){
                liger.get("prdTypCdNm").setDisabled(true);
            }
            if(liger.get("brCdNm")&&liger.get("brCdNm")!="undefined"){
                liger.get("brCdNm").setDisabled(true);
            }
            if(liger.get("buyWayCd")&&liger.get("buyWayCd")!="undefined"){
                liger.get("buyWayCd").setDisabled(true);
            }
            if(liger.get("splMfrId")&&liger.get("splMfrId")!="undefined"){
                liger.get("splMfrId").setDisabled(true);
            }
            if(liger.get("splAccNoId")&&liger.get("splAccNoId")!="undefined"){
                liger.get("splAccNoId").setDisabled(true);
            }
			if(liger.get("compensatorySplAccNoId")&&liger.get("compensatorySplAccNoId")!="undefined"){
				liger.get("compensatorySplAccNoId").setDisabled(true);
			}
            if(liger.get("splBackBankNoId")&&liger.get("splBackBankNoId")!="undefined"){
                liger.get("splBackBankNoId").setDisabled(true);
            }
            if(liger.get("salBackBankNoId")&&liger.get("salBackBankNoId")!="undefined"){
                liger.get("salBackBankNoId").setDisabled(true);
            }
            if(liger.get("isBckNo")&&liger.get("isBckNo")!="undefined"){
                liger.get("isBckNo").setDisabled(true);
            }
            if(liger.get("isSalBckNo")&&liger.get("isSalBckNo")!="undefined"){
                liger.get("isSalBckNo").setDisabled(true);
            }
            if(liger.get("splMfrId")&&liger.get("splMfrId")!="undefined"){
                liger.get("splMfrId").setDisabled(true);
            }
            if(liger.get("guidePc")&&liger.get("brCdNm")!="undefined"){
                liger.get("guidePc").setDisabled(true);
            }
            if(liger.get("mfrNm")&&liger.get("mfrNm")!="undefined"){
                liger.get("mfrNm").setDisabled(true);
            }

            if($("#prdRem")&&$("#prdRem")!="undefined"){
                $("#prdRem").setDisabled_ligerTextarea(true);
            }

            if($("#mOthInfo")&&$("#mOthInfo")!="undefined"){
                $("#mOthInfo").setDisabled_ligerTextarea(true);
            }

            if(liger.get("prdAmt")&&liger.get("prdAmt")!="undefined"){
                liger.get("prdAmt").setDisabled(true);
            }
            if(liger.get("isNew")&&liger.get("isNew")!="undefined"){
                liger.get("isNew").setDisabled(true);
            }

            if(liger.get("fuelTypCd")&&liger.get("fuelTypCd")!="undefined"){
                liger.get("fuelTypCd").setDisabled(true);
            }
            if(liger.get("rsrvPc")&&liger.get("rsrvPc")!="undefined"){
                liger.get("rsrvPc").setDisabled(true);
            }
            if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
                var qty = liger.get("prdQty");
                qty.setDisabled(true);
            }

            if(liger.get("irrPct")&&liger.get("irrPct")!="undefined"){
                liger.get("irrPct").setDisabled(true);
            }

            if(liger.get("deprRate")&&liger.get("deprRate")!="undefined"){
                liger.get("deprRate").setDisabled(true);
            }

            if(liger.get("deprAmt")&&liger.get("deprAmt")!="undefined"){
                liger.get("deprAmt").setDisabled(true);
            }
            if(liger.get("invAmt")&&liger.get("invAmt")!="undefined"){
                liger.get("invAmt").setDisabled(true);
            }

			if(isDetail==0 && (prjTypCd==ProjectConstant.PRJ_TYP_CD_CDDYWUL || prjTypCd==ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd==ProjectConstant.PRJ_TYP_CD_OWNJYD)){
				/*liger.get("certDt").setDisabled(false);
                liger.get("vehCheckCode").setDisabled(false);*/
			}else {
				if(liger.get("certDt")&&liger.get("certDt")!="undefined"){
					liger.get("certDt").setDisabled(true);
				}
				if(liger.get("vehCheckCode")&&liger.get("vehCheckCode")!="undefined"){
					liger.get("vehCheckCode").setDisabled(true);
				}
			}

            if(liger.get("secUsedPd")&&liger.get("secUsedPd")!="undefined"){
                liger.get("secUsedPd").setDisabled(true);
            }
            if(liger.get("deprRate")&&liger.get("deprRate")!="undefined"){
                liger.get("deprRate").setDisabled(true);
            }

            if(liger.get("deprAmt")&&liger.get("deprAmt")!="undefined"){
                liger.get("deprAmt").setDisabled(true);
            }
            if(liger.get("mfrNm")&&liger.get("mfrNm")!="undefined"){
                liger.get("mfrNm").setDisabled(true);
            }

            if($("#prdRem")&&$("#prdRem")!="undefined"){
                $("#prdRem").setDisabled_ligerTextarea(true);
            }
            if(liger.get("splId")&&liger.get("splId")!="undefined"){
                liger.get("splId").setDisabled(true);
            }
			if(liger.get("recommendSplId")&&liger.get("recommendSplId")!="undefined"){
				liger.get("recommendSplId").setDisabled(true);
			}
            if(liger.get("buyWayCd")&&liger.get("buyWayCd")!="undefined"){
                liger.get("buyWayCd").setDisabled(true);
            }


            if(liger.get("brTypCd")&&liger.get("brTypCd")!="undefined"){
                liger.get("brTypCd").setDisabled(true);
            }

            if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
                liger.get("prdQty").setDisabled(true);
            }
            //新能源
            if(liger.get("seatRowCd")&&liger.get("seatRowCd")!="undefined"){
                liger.get("seatRowCd").setDisabled(true);
            }
            if(liger.get("carVol")&&liger.get("carVol")!="undefined"){
                liger.get("carVol").setDisabled(true);
            }
            if(liger.get("extMil")&&liger.get("extMil")!="undefined"){
                liger.get("extMil").setDisabled(true);
            }
            if(liger.get("batDeg")&&liger.get("batDeg")!="undefined"){
                liger.get("batDeg").setDisabled(true);
            }
			if(liger.get("batBrand")&&liger.get("batBrand")!="undefined"){
				liger.get("batBrand").setDisabled(true);
			}
			/*if(isDetail==0 && buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK && ((prjTypCd==ProjectConstant.PRJ_TYP_CD_CDDYWUL) || (prjTypCd==ProjectConstant.PRJ_TYP_CD_ESCJYD))){
				liger.get("vehVal").setDisabled(false);
			}else {
				if(liger.get("vehVal")&&liger.get("vehVal")!="undefined"){
					liger.get("vehVal").setDisabled(true);
				}
			}*/
            if(liger.get("custFina")&&liger.get("custFina")!="undefined"){
                liger.get("custFina").setDisabled(true);
            }
            if(liger.get("isAdvLic")&&liger.get("isAdvLic")!="undefined"){
                liger.get("isAdvLic").setDisabled(true);
            }
            if(liger.get("advLicTm")&&liger.get("advLicTm")!="undefined"){
                liger.get("advLicTm").setDisabled(true);
            }
        }
		//是否可编辑推荐经销商
		if(liger.get("recommendSplId")&&liger.get("recommendSplId")!="undefined"&&isCanEditRecommendSpl == '0'){
			liger.get("recommendSplId").setDisabled(true);
		}
		//是否可编辑代偿担保账号信息（只有第一台车可编辑）
		if(liger.get("guaranteePaymentType")&&liger.get("guaranteePaymentType")!="undefined"&&isCanEditCompensatorySplInfo == '0'){
			liger.get("guaranteePaymentType").setDisabled(true);
			liger.get("guaranteePaymentId").setDisabled(true);
			if(compensatoryType == '1'){
				liger.get("compensatorySplAccNoId").setDisabled(true);
			}
			if(compensatoryType == '2'){
				liger.get("depositSplAccNoId").setDisabled(true);
			}
		}
		if(liger.get("compensatorySplBkNo")&&liger.get("compensatorySplBkNo")!="undefined"){
			liger.get("compensatorySplBkNo").setDisabled(true);
		}
		if(liger.get("compensatorySplBkNm")&&liger.get("compensatorySplBkNm")!="undefined"){
			liger.get("compensatorySplBkNm").setDisabled(true);
		}
		if(liger.get("compensatorySplRcptUnt")&&liger.get("compensatorySplRcptUnt")!="undefined"){
			liger.get("compensatorySplRcptUnt").setDisabled(true);
		}

		if(liger.get("depositSplBkNo")&&liger.get("depositSplBkNo")!="undefined"){
			liger.get("depositSplBkNo").setDisabled(true);
		}
		if(liger.get("depositSplBkNm")&&liger.get("depositSplBkNm")!="undefined"){
			liger.get("depositSplBkNm").setDisabled(true);
		}
		if(liger.get("depositSplRcptUnt")&&liger.get("depositSplRcptUnt")!="undefined"){
			liger.get("depositSplRcptUnt").setDisabled(true);
		}
        //是否可编辑推荐经销商
        if(isCanEditLnkCompInfo == '0'){
            /*liger.get("lnkCompNm").setDisabled(true);
            liger.get("lnkCompType").setDisabled(true);*/
			$('#lnkCompNm').attr("disabled",true);
			$('input:radio[name="lnkCompType"]').attr("disabled",true);
        }
        if($('input:radio[name="lnkCompType"]:checked').val() == '2'){
			$('#lnkCompNm').attr("disabled",true);
		}
        if(detailFlag=="true"){

            if(liger.get("mWhlSpec")&&liger.get("mWhlSpec")!="undefined"){
                liger.get("mWhlSpec").setDisabled(true);
            }
            if(liger.get("thickness")&&liger.get("thickness")!="undefined"){
                liger.get("thickness").setDisabled(true);
            }

            if(liger.get("grboxMdl")&&liger.get("grboxMdl")!="undefined"){
                liger.get("grboxMdl").setDisabled(true);
            }
            if(liger.get("actCntrSz")&&liger.get("actCntrSz")!="undefined"){
                liger.get("actCntrSz").setDisabled(true);
            }
            if($("#othInfo")&&$("#othInfo")!="undefined"){
                $("#othInfo").setDisabled_ligerTextarea(true);
            }
            if(liger.get("liftWayCd")&&liger.get("liftWayCd")!="undefined"){
                liger.get("liftWayCd").setDisabled(true);
            }
            if(liger.get("doorInfo")&&liger.get("doorInfo")!="undefined"){
                liger.get("doorInfo").setDisabled(true);
            }
            if(liger.get("cylSepc")&&liger.get("cylSepc")!="undefined"){
                liger.get("cylSepc").setDisabled(true);
            }
            if(liger.get("tankVol")&&liger.get("tankVol")!="undefined"){
                liger.get("tankVol").setDisabled(true);
            }
            if(liger.get("trlWhlSpec")&&liger.get("trlWhlSpec")!="undefined"){
                liger.get("trlWhlSpec").setDisabled(true);
            }
            if(liger.get("axleInfo")&&liger.get("axleInfo")!="undefined"){
                liger.get("axleInfo").setDisabled(true);
            }
            if(liger.get("matQalCd")&&liger.get("matQalCd")!="undefined"){
                liger.get("matQalCd").setDisabled(true);
            }

            if(liger.get("matQalCd")&&liger.get("matQalCd")!="undefined"){
                liger.get("matQalCd").setDisabled(true);
            }
            if(liger.get("isHvWhl")&&liger.get("isHvWhl")!="undefined"){
                liger.get("isHvWhl").setDisabled(true);
            }
            if(liger.get("trlWhlSpec")&&liger.get("trlWhlSpec")!="undefined"){
                liger.get("trlWhlSpec").setDisabled(true);
            }
            if(liger.get("liftWayCd")&&liger.get("liftWayCd")!="undefined"){
                liger.get("liftWayCd").setDisabled(true);
            }
            if(liger.get("isHvSub")&&liger.get("isHvSub")!="undefined"){
                liger.get("isHvSub").setDisabled(true);
            }

        }

        if(detailFlag=="true"){

            if(liger.get("prdClsCd")&&liger.get("prdClsCd")!="undefined"){
                liger.get("prdClsCd").setDisabled(true);
            }
            if(liger.get("cabSpec")&&liger.get("cabSpec")!="undefined"){
                liger.get("cabSpec").setDisabled(true);
            }
            if(liger.get("rearAxleSpec")&&liger.get("rearAxleSpec")!="undefined"){
                liger.get("rearAxleSpec").setDisabled(true);
            }
            if(liger.get("cntrSz")){
                liger.get("cntrSz").setDisabled(true);
            }
            if(liger.get("emiStd")){
                liger.get("emiStd").setDisabled(true);
            }
            if(liger.get("carMdl")&&liger.get("carMdl")!="undefined"){
                liger.get("carMdl").setDisabled(true);
            }
            if(liger.get("outVol")&&liger.get("outVol")!="undefined"){
                liger.get("outVol").setDisabled(true);
            }
            if(liger.get("grboxCfg")&&liger.get("grboxCfg")!="undefined"){
                liger.get("grboxCfg").setDisabled(true);
            }
            if(liger.get("carEngMdl")&&liger.get("carEngMdl")!="undefined"){
                liger.get("carEngMdl").setDisabled(true);
            }

            if(liger.get("carCl")&&liger.get("carCl")!="undefined"){
                liger.get("carCl").setDisabled(true);
            }
            if(liger.get("maxSpd")&&liger.get("maxSpd")!="undefined"){
                liger.get("maxSpd").setDisabled(true);
            }
            if($("#othCfg")&&$("#othCfg")!="undefined"){
                $("#othCfg").setDisabled_ligerTextarea(true);
            }
            if(liger.get("carLen")&&liger.get("carLen")!="undefined"){
                liger.get("carLen").setDisabled(true);
            }
            if(liger.get("drvTypCd")&&liger.get("drvTypCd")!="undefined"){
                liger.get("drvTypCd").setDisabled(true);
            }
            if(liger.get("carEngMdl")&&liger.get("carEngMdl")!="undefined"){
                liger.get("carEngMdl").setDisabled(true);
            }
            if(liger.get("hp")&&liger.get("hp")!="undefined"){
                liger.get("hp").setDisabled(true);
            }
            if(liger.get("prdYr")&&liger.get("prdYr")!="undefined"){
                liger.get("prdYr").setDisabled(true);
            }
            if(liger.get("prdCyCd")&&liger.get("prdCyCd")!="undefined"){
                liger.get("prdCyCd").setDisabled(true);
            }
            if(liger.get("grboxTypCd")&&liger.get("grboxTypCd")!="undefined"){
                liger.get("grboxTypCd").setDisabled(true);
            }
            if(liger.get("seatQtyCd")&&liger.get("seatQtyCd")!="undefined"){
                liger.get("seatQtyCd").setDisabled(true);
            }
            if(liger.get("carStrcCd")&&liger.get("carStrcCd")!="undefined"){
                liger.get("carStrcCd").setDisabled(true);
            }
            if(liger.get("prdWayCd")&&liger.get("prdWayCd")!="undefined"){
                liger.get("prdWayCd").setDisabled(true);
            }
            if(liger.get("powerTypCd")&&liger.get("powerTypCd")!="undefined"){
                liger.get("powerTypCd").setDisabled(true);
            }

            if(liger.get("carStrcCfg")&&liger.get("carStrcCfg")!="undefined"){
                liger.get("carStrcCfg").setDisabled(true);
            }
        }
        if((buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK)&&!((prjTypCd==ProjectConstant.PRJ_TYP_CD_CPYW && isSplMfr == '1')||(prjTypCd==ProjectConstant.PRJ_TYP_CD_CTYW && isSplMfr == '1'))
            &&!insCode){
            $("#guideMsgDiv").show();
        }
        // if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK){
        if(hasSplBackNo==1){
            $("#splBckBankAccDiv").show();
        }
        if(hasSalBackNo==1){
            $("#salBckBankAccDiv").show();
            $("#msgDiv").show();
        }
        if(hasBackNoFlag==1){
            //供应商返利账号、销售账号只读
            if(liger.get("splBackBankNoId")&&liger.get("splBackBankNoId")!="undefined"){
                liger.get("splBackBankNoId").setDisabled(true);
            }
            if(liger.get("salBackBankNoId")&&liger.get("salBackBankNoId")!="undefined"){
                liger.get("salBackBankNoId").setDisabled(true);
            }
            if(liger.get("isBckNo")&&liger.get("isBckNo")!="undefined"){
                liger.get("isBckNo").setDisabled(true);
            }
            if(liger.get("isSalBckNo")&&liger.get("isSalBckNo")!="undefined"){
                liger.get("isSalBckNo").setDisabled(true);
            }
        }

        if(hasAccNoFlag==1){

			if(liger.get("receiveTypeCd")&&liger.get("receiveTypeCd")!="undefined"){
				liger.get("receiveTypeCd").setDisabled(true);
			}
			if(liger.get("splId")&&liger.get("splId")!="undefined"){
				liger.get("splId").setDisabled(true);
			}
			if(liger.get("cstSplId")&&liger.get("cstSplId")!="undefined"){
				liger.get("cstSplId").setDisabled(true);
			}
			if(liger.get("cstSplAccNoId")&&liger.get("cstSplAccNoId")!="undefined"){
				liger.get("cstSplAccNoId").setDisabled(true);
			}
            //放款账号只读
            if(liger.get("splAccNoId")&&liger.get("splAccNoId")!="undefined"){
                liger.get("splAccNoId").setDisabled(true);
            }
        }
//	 }

        if((buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK)&&((prjTypCd==ProjectConstant.PRJ_TYP_CD_CDDYWUL)||(prjTypCd==ProjectConstant.PRJ_TYP_CD_ESCJYD) || prjTypCd==ProjectConstant.PRJ_TYP_CD_OWNJYD)){
            $("#vehValDiv").show();
            $("#custFinaDiv").show();
            $("#prdQty").val("1");
            $("#guidePc").val("0");
            $("#prdAmt").val("0");

			$("#prdQty").attr("validate","");
			$("#guidePc").attr("validate","");
			$("#prdAmt").attr("validate","");
            liger.get("prdQty").setDisabled(true);
            liger.get("guidePc").setDisabled(true);
            if(prjTypCd==ProjectConstant.PRJ_TYP_CD_CDDYWUL){
                $("#custFina").attr("validate","{required:true}");
            }
			/*if(isDetail==0 && buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK && ((prjTypCd==ProjectConstant.PRJ_TYP_CD_CDDYWUL) || (prjTypCd==ProjectConstant.PRJ_TYP_CD_ESCJYD))){
				liger.get("vehVal").setDisabled(false);
			}else {
				liger.get("vehVal").setDisabled(true);
			}*/
		}else{
			$("#vehValDiv").hide();
			$("#custFinaDiv").hide();
			$("#vehVal").attr("validate","");
			$("#custFina").attr("validate","");
		}

        if((buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK)&&((prjTypCd==ProjectConstant.PRJ_TYP_CD_CPYW && isSplMfr == '1')||(prjTypCd==ProjectConstant.PRJ_TYP_CD_CTYW && isSplMfr == '1'))){
            $("#splMfrDiv").show();
            $("#splMfrInfoValidate").attr("validate","{required:true}");
        }
        if(prjTypCd==ProjectConstant.PRJ_TYP_CD_CPYW || prjTypCd==ProjectConstant.PRJ_TYP_CD_LCV){
            $("#licenseCdDiv").show();
            $("#licenseCdTxt").show();
            $("#licenseCd").attr("validate","{required:true}");
        }else{
            $("#licenseCdDiv").hide();
            $("#licenseCdTxt").hide();
            $("#licenseCd").attr("validate","");
        }
        if(plcyTcode==ProjectConstant.PRD_PLCY_CD_C0002||plcyTcode==ProjectConstant.PRD_PLCY_CD_C0011){
            $("#drvTypCd").attr("validate","{required:true}");
            var html = '<span class="requiredSymbol" id="drvTypCdReq">*</span>';
            $("#drvTypCd").parent().append(html);
        }else{
            $("#drvTypCd").attr("validate","");
            $("#drvTypCdReq").hide();
        }
        $("#drvTypCd").change(function () {
            var drvTyp = $(this).val();
            if(plcyTcode==ProjectConstant.PRD_PLCY_CD_C0011&&drvTyp=="8×4"){
                $("#hp").attr("validate","{required:true}");
                var hpReq = $("#hpReq").text();
                if(!hpReq){
                    var hpHtml = '<span class="requiredSymbol"  id="hpReq">*</span>';
                    $("#hp").parent().append(hpHtml);
                }else{
                    $("#hpReq").show();
                }
            }else{
                $("#hp").attr("validate","");
                $("#hpReq").hide();
            }
        });

		//换车需求，新增产品信息时，项目相关信息取旧车的，不可修改
		if (prjPrdChangeFlag == "true") {
			$("#addBtnSpl").hide();
			$("#addBtnSplAccNo").hide();
			$("#addBtnSplBankAccNo").hide();
			$("#addBtnSalBackAccNo").hide();
			if(liger.get("guidePc")){
				liger.get("guidePc").setDisabled(true);
			}
			if(liger.get("prdQty")){
				liger.get("prdQty").setDisabled(true);
			}
			if(liger.get("prdAmt")){
				liger.get("prdAmt").setDisabled(true);
			}
			if(liger.get("rsrvPc")){
				liger.get("rsrvPc").setDisabled(true);
			}
			if(liger.get("vehVal")){
				liger.get("vehVal").setDisabled(true);
			}
			if(liger.get("custFina")){
				liger.get("custFina").setDisabled(true);
			}
			if(liger.get("irrPct")){
				liger.get("irrPct").setDisabled(true);
			}
			if(liger.get("receiveTypeCd")){
				liger.get("receiveTypeCd").setDisabled(true);
			}
			if(liger.get("splId")){
				liger.get("splId").setDisabled(true);
			}
			if(liger.get("recommendSplId")){
				liger.get("recommendSplId").setDisabled(true);
			}
			if(liger.get("cstSplId")){
				liger.get("cstSplId").setDisabled(true);
			}
			if(liger.get("yqCstSplId")){
				liger.get("yqCstSplId").setDisabled(true);
			}
			if(liger.get("cstSplAccNoId")){
				liger.get("cstSplAccNoId").setDisabled(true);
			}
			if(liger.get("yqSplAccNoId")){
				liger.get("yqSplAccNoId").setDisabled(true);
			}
			if(liger.get("splMfrId")){
				liger.get("splMfrId").setDisabled(true);
			}
			if(liger.get("isHaveBckNo")){
				liger.get("isHaveBckNo").setDisabled(true);
			}
			if(liger.get("isBckNo")){
				liger.get("isBckNo").setDisabled(true);
			}
			if(liger.get("splBackBankNoId")){
				liger.get("splBackBankNoId").setDisabled(true);
			}
			if(liger.get("isSalBckNo")){
				liger.get("isSalBckNo").setDisabled(true);
			}
			if(liger.get("salBackBankNoId")){
				liger.get("salBackBankNoId").setDisabled(true);
			}
			//放款账号只读
			if (liger.get("splAccNoId") && liger.get("splAccNoId") != "undefined") {
				liger.get("splAccNoId").setDisabled(true);
			}
		}

        //满足条件支持修改车辆参考价,车辆估值保持不变
        if(guidePcEditFlag == 1){
            //车辆参考价可以修改
            if(liger.get("guidePc")){
                liger.get("guidePc").setEnabled();
            }
            //车辆参数量可以修改
            if(liger.get("prdQty")){
                liger.get("prdQty").setEnabled();
            }
            var tempGuidePc = $("#guidePc").val();
            var tempVehVal = $("#vehVal").val();
			if(prjTypCd==ProjectConstant.PRJ_TYP_CD_CDDYWUL||prjTypCd==ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd==ProjectConstant.PRJ_TYP_CD_OWNJYD){
			    if(StringUtils.isNotEmpty(insGuidPc) && insGuidPc != 0){
                    tempVehVal = insGuidPc;
                }
				$("#custFina").val(insCustFina);
			}
            console.log("车辆参考价是否可编辑标志 tempGuidePc>>>>>>>>" + tempGuidePc) ;
            console.log("车辆参考价是否可编辑标志 tempVehVal>>>>>>>>" + tempVehVal) ;
            //新增产品时,设置参考价默认值为车辆估值
			if(!(tempGuidePc > 0)){
                $("#guidePc").val(tempVehVal);
                if(!($("#prdQty").val() > 0)){
                    $("#prdQty").val("1");
				}
				var tempPrdAmt = $("#prdQty").val() * $("#guidePc").val();
                console.log("车辆参考价是否可编辑标志 tempPrdAmt>>>>>>>>" + tempPrdAmt) ;
                $("#prdAmt").val(tempPrdAmt);
			}
        }

        //信审节点不允许修改车辆估值,收款方类型
        if(!(typeof isDetail == "undefined" || isDetail == null || isDetail == "") && isDetail==0){
            console.log("信审节点标志 isDetail>>>>>>>>" + isDetail) ;
            if(liger.get("receiveTypeCd")){
                liger.get("receiveTypeCd").setDisabled(true);
            }
        }

    });


    function addSpl(){
        var prdmarks = $("#prdmarks").val();
        //弹出框校验供应商是否已存在
        $.ligerDialog.SQopen({
            width: 600,
            height:180,
            title : '请填写供应商名称和税务登记号',
            url:'<%=path%>/product/splInfo/toCheckSplPage.do?lxxz='+true+'&prdmarks='+prdmarks,
            buttons: [{
                text: "确定", type: 'ok', cls: 'l-dialog-btn-ok',
                onclick: function (item, Dialog) {
                    if (Dialog.onOk) Dialog.onOk();
                }
            }, {
                text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
                onclick: function (item, Dialog) {
                    if (Dialog.onCancel) Dialog.onCancel();
                }
            }
            ]

        });
    }

    // 新增供应商账号
    function addSplAccNo(){
        var _splId =liger.get("splId").selectedValue;
        $.ligerDialog.SQopen({
            width: 900,
            height:400,
            title : '新增供应商账户',
            url:'<%=path%>/product/splBank/toAddPage.do?splId='+_splId,
            buttons: [{
                text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
                onclick: function (item, Dialog) {
                    //在子页面里绑定 frameElement.dialog.onOk = function () {}
                    if (Dialog.onOk) Dialog.onOk();
                }
            }, {
                text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
                onclick: function (item, Dialog) {
                    //在子页面里绑定 frameElement.dialog.onCancel = function () {}
                    if (Dialog.onCancel) Dialog.onCancel();
                }
            }
            ]
        });
    }

    // 新增供应商返利账号
    function addSplBackAccNo(){
        var _splId =liger.get("splId").selectedValue;
        $.ligerDialog.SQopen({
            width: 900,
            height:400,
            title : '新增供应商返利账户',
            url:'<%=path%>/product/splBank/toAddPage.do?splId='+_splId,
            buttons: [{
                text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
                onclick: function (item, Dialog) {
                    //在子页面里绑定 frameElement.dialog.onOk = function () {}
                    if (Dialog.onOk) Dialog.onOk();
                }
            }, {
                text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
                onclick: function (item, Dialog) {
                    //在子页面里绑定 frameElement.dialog.onCancel = function () {}
                    if (Dialog.onCancel) Dialog.onCancel();
                }
            }
            ]
        });
    }

    // 新增销售返利账号
    function addSalBackAccNo(){
        $.ligerDialog.SQopen({
            width: 900,
            height:400,
            title : '新增销售返利账户',
            url:'<%=path%>/rebacc/salerebaccinfo/toAddPage.do',
            buttons: [{
                text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
                onclick: function (item, Dialog) {
                    //在子页面里绑定 frameElement.dialog.onOk = function () {}
                    if (Dialog.onOk) Dialog.onOk();
                }
            }, {
                text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
                onclick: function (item, Dialog) {
                    //在子页面里绑定 frameElement.dialog.onCancel = function () {}
                    if (Dialog.onCancel) Dialog.onCancel();
                }
            }
            ]
        });
    }

    function checkAmt(){
		var purchaseFee = $("#rsrvPc").val();
		console.log("每台设备留购价的金额:" + purchaseFee);
		// 当留购价失去焦点的时候，会校验【当机构为浙银或兴邦的时候，每台设备留购价 字段 必须为0，不为0，报留购价必须为0，请修改】
		// 机构为浙银金租,兴邦租赁
		if(ProjectConstant.PRJ_INS_CODE_ZYFL == insCode || ProjectConstant.PRJ_INS_CODE_XBFL == insCode) {
			if (purchaseFee != 0) {
				top.$.ligerDialog.SQalert({content: "留购价必须为0，请修改", SQ_type: "warning"});
				return false;
			}
		} else if(ProjectConstant.PRJ_INS_CODE_APFL == insCode){
			if (purchaseFee != 10) {
				top.$.ligerDialog.SQalert({content: "留购价必须为10，请修改", SQ_type: "warning"});
				return false;
			}
		} else {
			var checkRsrvPc;
			var _url ='<%=path%>/project/prjprdbscinfo/checkRsrvPc.do';
			var params = {};
			if(!checkRsrvPc){
				$.ajax({
					type: 'get',
					dataType:'json',
					data:params,
					url: _url,
					success:function(msg){
						if(msg.success == 1){
							checkRsrvPc = msg.data;
							if(checkRsrvPc){
								checkRsrvPc = checkRsrvPc/100;
								var rsrvPc = $("#rsrvPc").val();
								if(rsrvPc<checkRsrvPc){
									top.$.ligerDialog.SQalert({content: "留购价不能小于100",SQ_type: "error"});
								}
							}
						}else{
							top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
						}
					}
				});
			}
		}
    }

    var audStsCdList = new Array();
    //audStsCdList.push(CommonConstant.C_AUD_NO_HAPPEN_CODE);
    // if(buOrgCd!=ProjectConstant.CODE_BU_ORG_CD_CAR){
    //     audStsCdList.push(CommonConstant.C_AUD_ADNWAY_CODE);
    // }
    audStsCdList.push(CommonConstant.C_AUD_PASS_CODE);
    var audStsCdListArr = JSON.stringify(audStsCdList);
    //设置折旧后金额
    function setSecAmt(){
        var invAmt = $("#invAmt").val();
        var secRate =  $("#deprRate").val();
        var discountAmt = 0;
        if(invAmt&&secRate){
            discountAmt = parseFloat(invAmt)*parseFloat(secRate);
        }
        $("#deprAmt").val(discountAmt);

    }

    function initData(){
        //默认数量为1
        var prdQty = $("#prdQty").val();
        if(prdQty==""){
            $("#prdQty").val("1");
        }
        if(insCode==ProjectConstant.PRJ_INS_CODE_ICBC){
            $("#rsrvPc").removeAttr("onblur");
            $("#rsrvPc").val(0);
            $("#prdQty").val("1");
            //数量为1不可修改
            /*if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
                liger.get("prdQty").setDisabled(true);
            }*/
            //添加提示
            /* 	var  mOthInfo = $("#mOthInfo");
                if($("#mOthInfo")){
                    var html = '<span style="color: red">请按照以下规则维护备注信息：<br/>合同号：**********，上装分期：*期、月供：*元；或此项目已包含上装部分报价</span>';
                $("#mOthInfo").before(html);
                } */
        }
        var rsrvPc = $("#rsrvPc").val();
        if(rsrvPc==""){
            $("#rsrvPc").val("100");
        }


        if(!liger.get("certDt")){
            //没有二手车信息，默认是新车，是否新车不可修改
            liger.get("isNew").setDisabled(true);
        }
        if(!id){
            var isNew = $("#isNew").val();
            if(prjTypCd==ProjectConstant.CODE_PRJ_TYP_CD_ESC||prjTypCd==ProjectConstant.PRJ_TYP_CD_CDDYWUL||prjTypCd==ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd==ProjectConstant.PRJ_TYP_CD_OWNJYD){
                liger.get("isNew").setValue("0");
                //$("#isNew").val("0");
                //设置不可选
                var slt=liger.get("isNew");
                slt.setDisabled(true);
                setUsedPdShow();
                $("#isNew").hide();
            }else{
                if(isNew=='1'){
                    //默认不可选
                    var slt=liger.get("secUsedPd");
                    slt.setDisabled(true);
                }
            }
        }



        var styleId = '${styleId}';
        var carSourceId = '${carSourceId}';
        var prdBscInfo = '${prdBscInfoVO}';
        var tkFlag ='${tkFlag}';
        var modifyFlag ='${modifyFlag}';
        if(modifyFlag){
            getDataByDetailId(id);
        }else{
            if(((prjTypCd==ProjectConstant.PRJ_TYP_CD_CDDYWUL)||(prjTypCd==ProjectConstant.PRJ_TYP_CD_ESCJYD) || prjTypCd==ProjectConstant.PRJ_TYP_CD_OWNJYD)){
                setDataByCarSourceId(carSourceId,prjTypCd,buOrgCd,prdDetailId);
            }else{
                setDataByPrdTypeAndDetailId(styleId);
            }
        }
        if(tkFlag){
            $("#lnkComp").show();
            $("#tkOption").show();
        }
        setUsePdOption();//设置已用月份option
        var guidePc = $("#guidePc").val();
        var prdQty = $("#prdQty").val();
        if(guidePc&&prdQty){
            //设置小计值
            guidePcChange();
        }
    }
    //设置小计值
    function guidePcChange(){
		if(prjTypCd == 'CDDYWYQ'){
			liger.get("guidePc").setDisabled(true);
		}
        var guidePc = $("#guidePc").ligerGetTextBoxManager().getValue();
        var prdQty = $("#prdQty").ligerGetTextBoxManager().getValue();
        var total =0;
        if(guidePc&&prdQty){
            total = NumberUtils.mul(guidePc,prdQty);
        }
        $("#total").text(total);
        $("#prdAmt").val(total);
    }
    //设置可选
    function setUsedPdShow(){

        var prdmarks = $("#prdmarks").val();
        var isNew = $("#isNew").val();
        if(isNew=='0'){
            $("#SecondPrd").show();
            if(prdmarks!="car"){
                $("#SecondPrdText").show();
            }
            setUsePdOption();
            var usedPd=liger.get("secUsedPd");
            if(usedPd){
                if(detailFlag!="true"){
                    usedPd.setEnabled(true);
                }else{
                    usedPd.setDisabled(true);
                }
            }
            if(prdmarks!="car"){
                setSecAmt();
            }
            $("#isNew").hide();
        }
        if(isNew=='1'){
            $("#SecondPrd").hide();
            $("#SecondPrdText").hide();
            var usedPd=liger.get("secUsedPd");
            setUsePdOption();
            if(usedPd){
                liger.get("secUsedPd").setValue(0);
                usedPd.setDisabled(true);
            }
        }
    }
    function setAdvLicTmShow(){
    	var isAdvLic = $("#isAdvLic").val();
    	if ("1" == isAdvLic){
    		$("#advLicTmDiv").show();
		}else {
    		$("#advLicTmDiv").hide();
		}
	}
    //设置可选
    function setUsedPd(){
        var certDt = liger.get("certDt").getValue();
        if(certDt){
            var date = new Date(certDt);
            var month=date.getMonth()+1;
            var currMonth = (new Date()).getMonth()+1;
            var year = date.getYear();
            var currYear = (new Date()).getYear();
            var diffMonth =(currYear-year)*12+ currMonth-month+1;
            liger.get("secUsedPd").setValue(diffMonth);

			//   var secUsedPd = $("#secUsedPd").val(diffMonth+"");
			//设置usedPd值，并设为不可选
			var usedPd=liger.get("usedPd");
			if(usedPd){
				liger.get("usedPd").setValue(diffMonth);
				usedPd.setDisabled(true);
			}
			//设置折旧率
			var _url ='<%=path%>/project/prjbscinfo/getDiscountRate.do';
			var params = {};
			params.month=diffMonth;
			$.ajax({
				type: 'get',
				dataType:'json',
				data:params,
				url: _url,
				success:function(msg){
					if(msg.success == 1){
						$("#deprRate").val(msg.data);
					}else{
						top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
					}
				}
			});

        }
    }
    var fromCddFlag = '${fromCddFlag}';
    function getDataByDetailId(prjPrdId){
        //if(fromCddFlag==1)return;
        var _url ='<%=path%>/project/vehicle/getPrjPrdBscInfoAndExtById.do';
        if(!prjPrdId)return;

        $.ajax({
            type: 'get',
            dataType:'json',
            data:{id:prjPrdId},
            url: _url,
            success:function(msg){
                if(msg){
                    setPrjPrdBscInfo(msg);//设置数据
                }else{
                    top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                }
            }
        });
    }
    function setPrjPrdBscInfo(basePrdInfo){
        console.log("setPrjPrdBscInfo 厂商指导价-->"+basePrdInfo.mfrGuidePc);
        var prjPrdExtVO = basePrdInfo.prjPrdExtVO;
        var prjPrdSourceVO = basePrdInfo.prjPrdSourceInfo;
        setMfrComboBoxText(basePrdInfo.mfrNm)
        if(basePrdInfo){
            var basePrdForm1 = liger.get("basePrdForm1");
            basePrdForm1.setData({
                prdNm: basePrdInfo.prdNm,
                carStyleName: basePrdInfo.carStyleName,
                modelNm: basePrdInfo.modelNm,
                prdClsCdNm: basePrdInfo.prdClsCdNm,
                prdTypCd: basePrdInfo.prdTypCd,
                prdCd: basePrdInfo.prdCd,
                brCdNm:basePrdInfo.brCd,
                brCd: basePrdInfo.brCd,
                prdMdl: basePrdInfo.prdMdl,
                prdMdlSun: basePrdInfo.prdMdlSun,
                mfrId: basePrdInfo.mfrId,
                mfrNm: basePrdInfo.mfrNm,
                prdRem: basePrdInfo.prdRem,
                audStsCd: basePrdInfo.audStsCd,
                prdTypCdNm: basePrdInfo.prdTypCdNm,
                isNew :basePrdInfo.isNew ,
                usedPd :basePrdInfo.usedPd ,
                secUsedPd :basePrdInfo.usedPd ,
                rsrvPc :basePrdInfo.rsrvPc ,
                guidePc :basePrdInfo.guidePc,
                mfrGuidePc: basePrdInfo.mfrGuidePc,
                prdQty :basePrdInfo.prdQty ,
                prdAmt :basePrdInfo.prdAmt ,
                prdUseCd :basePrdInfo.prdUseCd ,
                prdRem :basePrdInfo.prdRem ,
                irrPct :basePrdInfo.irrPct ,
                prdbscInfoId:basePrdInfo.id,
                usedPd:basePrdInfo.usedPd,
                prdAmt:basePrdInfo.prdAmt,
                certDt:basePrdInfo.certDt,
                invAmt:basePrdInfo.invAmt,
                splId:basePrdInfo.splId,
                prdId:basePrdInfo.prdId,
                guidePc:basePrdInfo.guidePc,
                splAccNoId:basePrdInfo.splAccNoId,
				compensatorySplAccNoId:basePrdInfo.compensatorySplAccNoId,
                vehVal:basePrdInfo.vehVal,
                custFina:basePrdInfo.custFina,
                carSourceId:basePrdInfo.carSourceId,
                carNo:basePrdInfo.carNo,
                releaseDate:basePrdInfo.releaseDate,
				//
				certDt:basePrdInfo.certDt,
				invAmt:basePrdInfo.invAmt,
				deprRate:basePrdInfo.deprRate,
				deprAmt:basePrdInfo.deprAmt,
				prdDtlId:basePrdInfo.prdDtlId,
				vehCheckCode:basePrdInfo.vehCheckCode,
                loanableAmt:basePrdInfo.loanableAmt,
				isAdvLic:basePrdInfo.isAdvLic,
				advLicTm:basePrdInfo.advLicTm
			});
			if(StringUtils.isNotEmpty(basePrdInfo.ctrValue)){
				if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
					liger.get("prdQty").setDisabled(true);
				}
			}
			$("#mfrId").val(basePrdInfo.mfrId);
			$("#brCd").val(basePrdInfo.brCd);
			$("#carId").val(basePrdInfo.id);
			$("#tkId").val(basePrdInfo.id);
			$("#isNew").val(basePrdInfo.isNew);
			$("#prdId").val(basePrdInfo.prdId);
			$("#prdDtlId").val(basePrdInfo.prdDtlId);
			$("#prdbscInfoId").val(basePrdInfo.id);
			$("#vehCheckCode").val(basePrdInfo.vehCheckCode);
			if (buOrgCd == ProjectConstant.CODE_BU_ORG_CD_XNY && prjTypCd == 'CPYW') {
                $("#isAdvLic").val(basePrdInfo.isAdvLic);
				if (basePrdInfo.isAdvLic==1){
					var advLicTmStr = renderDate(basePrdInfo.advLicTm);
					$("#advLicTm").val(advLicTmStr);
				}
            }
			searchSplNm = basePrdInfo.splNm;
			var guidePc = $("#guidePc").ligerGetTextBoxManager().getValue();
			var prdQty = $("#prdQty").ligerGetTextBoxManager().getValue();
			var total = NumberUtils.mul(guidePc,prdQty);
			$("#total").text(total);
			beforePrdQty = prdQty;
			beforeGuidePc = guidePc;
			beforeRsrvPc = $("#rsrvPc").val();
            beforeVehVal = $("#vehVal").val();
            beforeCustFina = $("#custFina").val();
            basePrdForm1 = liger.get("basePrdForm1");
            $("#isTk").hide();
            $("#prdmarks").val("car");
            liger.get("isNew").setEnabled(true);


            basePrdForm1.setData({
                /* prdSeries: carInfo.prdSeries, */
                modelNm:prjPrdExtVO.modelName,
                productionCompany:prjPrdExtVO.productionCompany,
                carLen: prjPrdExtVO.carLen,
                prdYr: prjPrdExtVO.prdYr,
                prdCyCd: prjPrdExtVO.prdCyCd,
                outVol: prjPrdExtVO.outVol,
                prdMdlSun: prjPrdExtVO.prdMdl,
                grboxTypCd: prjPrdExtVO.grboxTypfd,
                grboxCfg: prjPrdExtVO.grboxCfg,
                seatQtyCd: prjPrdExtVO.seatQtyCd,
                engMdl: prjPrdExtVO.engMdl,
                drvTypCd: prjPrdExtVO.drvTypCd,
                carStrcCd: prjPrdExtVO.carStrcCd,
                carStrcCfg: prjPrdExtVO.carStrcCfg,
                powerTypCd: prjPrdExtVO.powerTypCd,
                carCl: prjPrdExtVO.carCl,
                maxSpd: prjPrdExtVO.maxSpd,
                prdWayCd: prjPrdExtVO.prdWayCd,
                carMdl: prjPrdExtVO.carMdl,
                othCfg: prjPrdExtVO.othCfg,
                carVol: prjPrdExtVO.carVol,
                extMil: prjPrdExtVO.extMil,
                batDeg: prjPrdExtVO.batDeg,
				batBrand: prjPrdExtVO.batBrand,
                emiStdCd:prjPrdExtVO.emiStdCd,
                carId:prjPrdExtVO.id,
                prdLvlCd:prjPrdExtVO.prdLvlCd
            });
            $("#carId").val(prjPrdExtVO.id);
            basePrdForm1 = liger.get("basePrdForm1");
            basePrdForm1.setData({
                prdId: prjPrdExtVO.prdId,
                drvTyp: prjPrdExtVO.drvTyp,
                engMdl: prjPrdExtVO.engMdl,
                hp: prjPrdExtVO.hp,
                emiStd: prjPrdExtVO.emiStd,
                cabSpec: prjPrdExtVO.cabSpec,
                prdMdlSun: prjPrdExtVO.prdMdl,
                grboxMdl: prjPrdExtVO.grboxMdl,
                rearAxleSpec: prjPrdExtVO.rearAxleSpec,
                mWhlSpec: prjPrdExtVO.mwhlSpec,
                prdClsCd: prjPrdExtVO.prdClsCd,
                prdCd: prjPrdExtVO.prdCd,
                //prdMdl: basePrdInfo.prdMdl,
                cntrSz: prjPrdExtVO.cntrSz,
                actCntrSz: prjPrdExtVO.actCntrSz,
                thickness: prjPrdExtVO.thickness,
                axleInfo: prjPrdExtVO.axleInfo,
                matQalCd: prjPrdExtVO.matQalCd,
                liftWayCd: prjPrdExtVO.liftWayCd,
                doorInfo: prjPrdExtVO.doorInfo,
                isHvWhl: prjPrdExtVO.isHvWhl,
                trlWhlSpec: prjPrdExtVO.trlWhlSpec,
                cylSepc: prjPrdExtVO.cylSepc,
                tankVol: prjPrdExtVO.tankVol,
                othInfo: prjPrdExtVO.othInfo,
                tkId:prjPrdExtVO.id,
                brTypCd:prjPrdExtVO.brTypCd,
                buyWayCd:prjPrdExtVO.buyWayCd,
                prdClsCd:prjPrdExtVO.prdClsCd,
                emiStd:prjPrdExtVO.emiStd,
                gasCylSpec:prjPrdExtVO.gasCylSpec,
                saddleSpec:prjPrdExtVO.saddleSpec,
                isHvAirCnd:prjPrdExtVO.isHvAirCnd,
                whlBase:prjPrdExtVO.whlBase,
                isHvSub:prjPrdExtVO.isHvSub,
                batDeg:prjPrdExtVO.batDeg,
				batBrand:prjPrdExtVO.batBrand,
                seatRowCd:prjPrdExtVO.seatRowCd,
                clsExfPc:prjPrdExtVO.clsExfPc,
                mOthInfo:prjPrdExtVO.mothInfo,
                gerrBoxBrand:prjPrdExtVO.gerrBoxBrand,
                styleEngine:prjPrdExtVO.styleEngine,
                fuelTypCd:prjPrdExtVO.fuelTypCd,
				tvlMil:prjPrdExtVO.tvlMil,
            });


            basePrdForm1 = liger.get("basePrdForm1");
            basePrdForm1.setData({
                parkingLot: prjPrdSourceVO.parkingLot,
                classNm: prjPrdSourceVO.classNm,
                vehCheckCodeNm: basePrdInfo.vehCheckCodeNm,
                vehCheckCode: basePrdInfo.vehCheckCode,
                surveyorNm: prjPrdSourceVO.surveyorNm,
                vehValNew: prjPrdSourceVO.vehValNew,
                vehVal: basePrdInfo.vehVal,
                timeDiff: prjPrdSourceVO.timeDiff,
                licDt:prjPrdSourceVO.licDt,
                licNo:prjPrdSourceVO.licNo
            });
            setUsedPdShow();
            setSecAmt();
            var vehVel = $("#vehVel").val();
            var vehValNew = $("#vehValNew").val();

            if(vehVel){
                var val1 = parseFloat(basePrdInfo.vehVal).toFixed(2);
                $("#vehVel").val(val1);
            }
            if(vehValNew){
                var val = parseFloat(prjPrdSourceVO.vehValNew).toFixed(2);
                $("#vehValNew").val(val);
            }
            if(vehVel&&vehValNew){
               var val =  (parseFloat((vehVel-vehValNew)/vehVel)).toFixed(2);
                $("#floatPct").val(val);
            }

            var releaseDateStr = renderDate(basePrdInfo.releaseDate);
            $("#releaseDate").val(releaseDateStr);
        }
    }
    //格式化时间
    function renderDate(value){
        var dateStr = "";
        if(null != value){
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }
    function setDataByPrdTypeAndDetailId(styleId){
        var _url ='<%=path%>/project/vehicle/carDetail.do';
        $.ajax({
            type: 'get',
            dataType:'json',
            data:{id:styleId},
            url: _url,
            async:false,
            success:function(msg){
                if(msg){
                    setData(msg);//设置数据
                }else{
                    top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                }
            }
        });
    }

    function setDataByCarSourceId(carSourceId,prjTypCd,buOrgCd,prdDetailId){
		console.log("车源id:"+carSourceId);
        var _url ='<%=path%>/project/vehicleSrc/carDetail.do';
        $.ajax({
            type: 'get',
            dataType:'json',
            data:{id:carSourceId,prjTypCd:prjTypCd,buOrgCd:buOrgCd,prdDetailId:prdDetailId},
            url: _url,
            async:false,
            success:function(msg){
                if(msg){
                    setData(msg);//设置数据
                }else{
                    top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                }
            }
        });
    }


    var comboGrid_defaultValue1='${splId}';
	var comboGrid_defaultText1 = '${splNm}';
    var isInit_setSearchComboVal1 = false;
	var COMBO_SPL = $("#splId").ligerComboBox({
			width: 300,
			selectBoxWidth: 300,
			selectBoxHeight: 240,
			valueField: 'id',
			textField: 'splNm',
			isMultiSelect: true,
			isSingleCheck: true,
			grid: getSplGridOptions(true),
			parms: {condition:JSON.stringify([{"op":"like","field":"splNm","value": comboGrid_defaultText1,"type":"text"}])},
			condition: {
				labelWidth: 0,
				space: 5,
				fields: [{ name: 'splNm', width: 90, type:'text' , keyName: 'id'}]
			},
			/*     conditionSearchClick: function (a) {
                    COMBO_MNG.grid.loadData($.ligerFilter.getFilterFunction(a.rules));
                }, */
			delayLoadGrid: false,
			onChangeValue: function (value) {
				if (COMBO_SPL) {
					if (value=="") comboGrid_defaultValue1 = ""; //如果点击清空'x'，就滞空初始值
					$("#splId").show_ligerComboItems(".combo_itemList_wrap");
				};
				var _selected = this.gridManager.getSelected()
				var rcId = _selected && _selected.rcCstBscInfoId;
				if(typeof(rcId) != "undefined" && rcId!=null){
					_rcCstBscInfoId = rcId;
				}
				SetIframe_height();
				if(liger.get('splAccNoId') && liger.get('splAccNoId').grid.rows.length>0){
					liger.get('splAccNoId').clear();
				}
			}
		});
	//供应商
	if (prjTypCd != 'CDDYWYQ') {
		liger.get("splNm").setValue(searchSplNm);
	}
	//var selectSplNm =  liger.get("splNm").getValue();
	function getSplGridOptions(checkbox){
		if($("#receiveTypeCd").val() != ProjectConstant.RECEIVE_TYPE_CD_SPL){
			comboGrid_defaultValue1 = '';
			comboGrid_defaultText1 = '';
		}
		var url = '<%=path%>/project/prjprdbscinfo/splInitList.do?audStsCdList='+audStsCdListArr+'&prjId='+_prjId;
		/*if(compensatoryType == '1'){
			url = '<%=path%>/project/prjprdbscinfo/splInitList.do?audStsCdList='+audStsCdListArr+'&prjId='+_prjId+'&isQueryCompensatoryInfo=1';
		}*/
		//if(fromCddFlag==1)return;
		var _prjId = '${prjId}';
		var options = {
			columns: [
				{ display: '供应商名称', name: 'splNm',
					render: function (rowdata, rowindex, value, column) {
						value ==null?"":value;
						var h = '';
						var audStsCd = rowdata.audStsCd;
						if(audStsCd){
							if(audStsCd==FlowConstant.FLOW_CHECK_STATE_NON||audStsCd==FlowConstant.FLOW_CHECK_STATE_IN){
								// h+='<i class="ico_flasher"></i>';
							}
						}
						h+=value;
						return h;
					},
					minWidth: 150 },
				{ display: '企业性质', name: 'corpTypCdNm', minWidth: 100 },
				{ display: '经营范围', name: 'bizScope', minWidth: 150 },
				{ display: '注册资本', name: 'regCapAmt', minWidth: 50 },
				{ display: '实收资本', name: 'paidCapAmt', minWidth: 50 },
				{ display: '黑名单', name: 'isBlackList',width:1, hide:true},
			],
			switchPageSizeApplyComboBox: false,
			url: '<%=path%>/project/prjprdbscinfo/splInitList.do?audStsCdList='+audStsCdListArr+'&prjId='+_prjId,
			//parms: {condition:[{"op":"like","field":"splNm","value": comboGrid_defaultValue1,"type":"text"}]},
			method: 'get',
			dataAction: 'local',
			root:'rows',
			record:'total',
			pageSize: 10,
			usePagerOnLessPagesize: false,
			cssClass: "SMALL_grid",
			isSingleCheck: true,
			frozen: false,
			isSelected: function (rowdata) {

				if (comboGrid_defaultValue1 == "") return false;
				var defaultItems = comboGrid_defaultValue1.split(";");
				if(!isInit_setSearchComboVal1) { //只在初始化时执行一次，在onAfterShowData后改变
					for (var i = 0; i < defaultItems.length; i++) {
						if(rowdata[COMBO_SPL.options.valueField] == defaultItems[i]) {
							return true;
						}
					};
				};
				return false;
			},
			onAfterShowData: function (currentData) {
				if(!isInit_setSearchComboVal1) { //只在初始化时执行一次，在onAfterShowData后改变
					// COMBO_SPL.setInputValue(comboGrid_defaultValue1, comboGrid_defaultText1, true);
					COMBO_SPL.setInputValue(splIdVal, comboGrid_defaultText1, true);
					$("input[name='splNm']").val(comboGrid_defaultText1);
					isInit_setSearchComboVal1 = true;
                }
            },
            onSelectRow:function(rowdata){
                if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK){
                    if(rowdata){
                        if(rowdata.isBlackList=='1'){
                            $.ligerDialog.error("该挂靠公司列为黑名单，请重新选择");
                            return false;
                        }
                    }
                }
                return true;
            }
        };
        return options;
    }
	var comboGrid_defaultValue8='${recommendSplId}';
	var comboGrid_defaultText8 = '${recommendSplNm}';
	var isInit_setSearchComboVal8 = false;
	var RECOMMEND_COMBO_SPL = $("#recommendSplId").ligerComboBox({
		width: 300,
		selectBoxWidth: 300,
		selectBoxHeight: 240,
		valueField: 'id',
		textField: 'splNm',
		isMultiSelect: true,
		isSingleCheck: true,
		grid: getSplRecommendGridOptions(true),
		parms: {condition:JSON.stringify([{"op":"like","field":"recommendSplNm","value": comboGrid_defaultText8,"type":"text"}])},
		condition: {
			labelWidth: 0,
			space: 5,
			fields: [{ name: 'recommendSplNm', width: 90, type:'text' , keyName: 'id'}]
		},
		/*     conditionSearchClick: function (a) {
                COMBO_MNG.grid.loadData($.ligerFilter.getFilterFunction(a.rules));
            }, */
		delayLoadGrid: false,
		onChangeValue: function (value) {
			if (RECOMMEND_COMBO_SPL) {
				if (value=="") comboGrid_defaultValue8 = ""; //如果点击清空'x'，就滞空初始值
				var _selected = this.gridManager.getSelected();
				$("#recommendSplId").show_ligerComboItems(".combo_itemList_wrap");
			}
			SetIframe_height();
			//liger.get('splAccNoId').clear();
		}
	});
	//供应商
	//var selectSplNm =  liger.get("splNm").getValue();
	function getSplRecommendGridOptions(checkbox){
		var _prjId = '${prjId}';
		var options = {
			columns: [
				{ display: '供应商名称', name: 'splNm', minWidth: 150 },
				{ display: '企业性质', name: 'corpTypCdNm', minWidth: 100 },
				{ display: '经营范围', name: 'bizScope', minWidth: 150 },
				{ display: '注册资本', name: 'regCapAmt', minWidth: 50 },
				{ display: '实收资本', name: 'paidCapAmt', minWidth: 50 },
				{ display: '黑名单', name: 'isBlackList',width:1, hide:true},
			],
			switchPageSizeApplyComboBox: true,
			url: '<%=path%>/project/prjprdbscinfo/recommendSplInitList.do?audStsCdList=2'+'&prjId='+_prjId+'&isSelectVerify=1',
			//parms: {condition:[{"op":"like","field":"splNm","value": comboGrid_defaultValue1,"type":"text"}]},
			method: 'get',
			dataAction: 'server',
			root:'rows',
			record:'total',
			pageSize: 10,
			usePagerOnLessPagesize: true,
			cssClass: "SMALL_grid",
			isSingleCheck: true,
			frozen: false,
			isSelected: function (rowdata) {

				if (comboGrid_defaultValue8 == "") return false;
				var defaultItems = comboGrid_defaultValue8.split(";");
				if(!isInit_setSearchComboVal8) { //只在初始化时执行一次，在onAfterShowData后改变
					for (var i = 0; i < defaultItems.length; i++) {
						if(rowdata[RECOMMEND_COMBO_SPL.options.valueField] == defaultItems[i]) {
							return true;
						}
					};
				};
				return false;
			},
			onAfterShowData: function (currentData) {
				if(!isInit_setSearchComboVal8) { //只在初始化时执行一次，在onAfterShowData后改变
					// COMBO_SPL.setInputValue(comboGrid_defaultValue1, comboGrid_defaultText1, true);
					RECOMMEND_COMBO_SPL.setInputValue(comboGrid_defaultValue8, comboGrid_defaultText8, true);
					$("input[name='recommendSplNm']").val(comboGrid_defaultText8);
					isInit_setSearchComboVal8 = true;
				}
			},
			onSelectRow:function(rowdata){
				/*if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK){
					if(rowdata){
						if(rowdata.isBlackList=='1'){
							$.ligerDialog.error("该挂靠公司列为黑名单，请重新选择");
							console.log(2222)
							return false;
						}
					}
				}*/

				return true;
			}
		};
		return options;
	}

	var comboGrid_defaultValue9='${guaranteePaymentId}';
	var comboGrid_defaultText9 = '${guaranteePaymentNm}';
	var guaranteePaymentType = '${guaranteePaymentType}';
	var GUARANEEPAYMENT_CHANNEL_INFO;
	var isInit_setSearchComboVal9 = false;
	function getGuaranteeChannelInfo(selectedValue) {

		//var guaranteePaymentType = liger.get("guaranteePaymentType").selectedValue;
		if(GUARANEEPAYMENT_CHANNEL_INFO && GUARANEEPAYMENT_CHANNEL_INFO.gridManager) {
			GUARANEEPAYMENT_CHANNEL_INFO.grid.loadServerData({'guaranteePaymentType': selectedValue,'guaranteePaymentNm': '','compensatoryType': compensatoryType,  'page' : '1'});
			return;
		}
		GUARANEEPAYMENT_CHANNEL_INFO = $("#guaranteePaymentId").ligerComboBox({
			width: 300,
			selectBoxWidth: 300,
			selectBoxHeight: 240,
			valueField: 'guaranteePaymentId',
			textField: 'guaranteePaymentNm',
			isMultiSelect: true,
			isSingleCheck: true,
			grid: getGuaranteePaymentChannelInfoGridOptions(true),
			parms: {condition:JSON.stringify([{"op":"like","field":"guaranteePaymentNm","value": comboGrid_defaultText9,"type":"text"},{"op":"like","field":"guaranteePaymentType","value": selectedValue,"type":"text"},{"op":"like","field":"compensatoryType","value": compensatoryType,"type":"text"}])},
			condition: {
				labelWidth: 0,
				space: 5,
				fields: [{ name: 'guaranteePaymentNm', width: 90, type:'text' , keyName: 'id'}]
			},
			conditionSearchClick: function (a) {
				var guaranteePaymentNm;
				if (a.rules.length == 0) {
					guaranteePaymentNm = '';
				} else {
					guaranteePaymentNm = a.rules[0].value;
				}
				GUARANEEPAYMENT_CHANNEL_INFO.grid.options.newPage = 1;
				var guaranteePaymentType = liger.get("guaranteePaymentType").selectedValue;
				GUARANEEPAYMENT_CHANNEL_INFO.grid.loadServerData({'guaranteePaymentType': guaranteePaymentType,'guaranteePaymentNm': guaranteePaymentNm,'compensatoryType': compensatoryType,  'page' : '1'});
			},
			delayLoadGrid: false,
			onChangeValue: function (value) {
				if (GUARANEEPAYMENT_CHANNEL_INFO) {
					if (value=="") comboGrid_defaultValue9 = ""; //如果点击清空'x'，就滞空初始值
					var _selected = this.gridManager.getSelected();
					$("#guaranteePaymentId").show_ligerComboItems(".combo_itemList_wrap");
				}
				SetIframe_height();
				//liger.get('splAccNoId').clear();
			}
		});
	}

	function getGuaranteePaymentChannelInfoGridOptions(checkbox){
		//var guaranteePaymentType = $('#guaranteePaymentType').val();
		var guaranteePaymentType = liger.get("guaranteePaymentType").selectedValue;
		var options = {
			columns: [
				{ display: '担保主体名称', name: 'guaranteePaymentNm', minWidth: 150 },
			],
			switchPageSizeApplyComboBox: true,
			url: '<%=path%>/project/prjprdbscinfo/queryGuaranteeChannelList.do',
			//parms: {condition:JSON.stringify([{"op":"like","field":"guaranteePaymentNm","value": comboGrid_defaultText9,"type":"text"},{"op":"like","field":"guaranteePaymentType","value": guaranteePaymentType,"type":"text"},{"op":"like","field":"compensatoryType","value": compensatoryType,"type":"text"}])},
			method: 'get',
			dataAction: 'server',
			root:'rows',
			record:'total',
			pageSize: 10,
			usePagerOnLessPagesize: true,
			cssClass: "SMALL_grid",
			isSingleCheck: true,
			frozen: false,
			isSelected: function (rowdata) {

				if (comboGrid_defaultValue9 == "") return false;
				var defaultItems = comboGrid_defaultValue9.split(";");
				if(!isInit_setSearchComboVal9) { //只在初始化时执行一次，在onAfterShowData后改变
					for (var i = 0; i < defaultItems.length; i++) {
						if(rowdata[GUARANEEPAYMENT_CHANNEL_INFO.options.valueField] == defaultItems[i]) {
							return true;
						}
					};
				};
				return false;
			},
			onAfterShowData: function (currentData) {
				if(!isInit_setSearchComboVal9) { //只在初始化时执行一次，在onAfterShowData后改变
					// COMBO_SPL.setInputValue(comboGrid_defaultValue1, comboGrid_defaultText1, true);
					console.log(comboGrid_defaultValue9 + 'comboGrid_defaultValue9');
					comboGrid_defaultValue9='${guaranteePaymentId}';
					GUARANEEPAYMENT_CHANNEL_INFO.setInputValue(comboGrid_defaultValue9, comboGrid_defaultText9, true);
					$("input[name='guaranteePaymentNm']").val(comboGrid_defaultText9);
					isInit_setSearchComboVal9 = true;
				}
			},
			onSelectRow:function(rowdata){
				/*if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK){
					if(rowdata){
						if(rowdata.isBlackList=='1'){
							$.ligerDialog.error("该挂靠公司列为黑名单，请重新选择");
							console.log(2222)
							return false;
						}
					}
				}*/

				return true;
			},
			/*onChangePage: function(){
				var guaranteePaymentType = liger.get("guaranteePaymentType").selectedValue;
				GUARANEEPAYMENT_CHANNEL_INFO.grid.loadServerData({'guaranteePaymentType': guaranteePaymentType,'guaranteePaymentNm': '','compensatoryType': compensatoryType,  'page' : '1'});
			},*/
			onChangePage: function (page) {
				console.log(page);
				GUARANEEPAYMENT_CHANNEL_INFO.grid.options.newPage = page;
				GUARANEEPAYMENT_CHANNEL_INFO.grid.setParm('guaranteePaymentType', liger.get("guaranteePaymentType").selectedValue);
				GUARANEEPAYMENT_CHANNEL_INFO.grid.setParm('compensatoryType', compensatoryType);
			},
		};
		return options;
	}

    function setUsePdOption(){
        var html = "";
        for(var i=1;i<31;i++){
            html+="<option value="+i+">"+i+"个月</option>";
        }
        $("#secUsedPd").append(html);
    }

    function setMfrComboBoxText(mfrNm){
        if(mfrNm){
            var mfrComboBox = liger.get("mfr");
            if(mfrComboBox){
                mfrComboBox.setText(mfrNm);
            }
        }
    }



    function setData(basePrdInfo){
        console.log("setData 厂商指导价-->"+basePrdInfo.mfrGuidePc);
        var basePrdForm1 = liger.get("basePrdForm1");
        if(StringUtils.isNotEmpty(basePrdInfo.ctrValue)){
            if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
                liger.get("prdQty").setDisabled(true);
            }
            basePrdForm1.setData({
                prdQty: basePrdInfo.ctrValue
            });
        }else{
			if(!(liger.get("prdQty")&&liger.get("prdQty")!="undefined")){
				basePrdForm1.setData({
					prdQty: 1
				});
			}
        }
        basePrdForm1.setData({
            modelNm:basePrdInfo.modelName,
            carStyleName:basePrdInfo.carStyleName,
            styleId:basePrdInfo.styleId,
            productionCompany:basePrdInfo.productionCompany,
            prdNm: basePrdInfo.prdNm,
            prdClsCdNm: basePrdInfo.prdClsCdNm,
            prdClsCd: basePrdInfo.prdClsCd,
            prdCd: basePrdInfo.prdCd,
            prdTypCd: basePrdInfo.prdTypCd,
            brCdNm:basePrdInfo.brCdNm,
            brCd: basePrdInfo.brCd,
            prdMdl: basePrdInfo.prdMdl,
            prdMdlSun:basePrdInfo.prdMdl,
            secUsedPd :basePrdInfo.usedPd ,
            mfrId: basePrdInfo.mfrId,
            mfrNm: basePrdInfo.mfrNm,
            mfrGuidePc: basePrdInfo.mfrGuidePc,
            guidePc :basePrdInfo.guidePcDouble,
            prdRem: basePrdInfo.prdRem,
            audStsCd: basePrdInfo.audStsCd,
            prdTypCdNm: basePrdInfo.prdTypCdNm,
            prdId:basePrdInfo.id,
            gerrBoxBrand:basePrdInfo.gerrBoxBrand,
            styleEngine:basePrdInfo.styleEngine,
            releaseDate:basePrdInfo.releaseDateStr,
            carSourceId:basePrdInfo.carSourceId,
            carNo:basePrdInfo.carNo,
            vehCheckCode:basePrdInfo.vehCheckCode,
            vehCheckCodeNm:basePrdInfo.vehCheckCodeNm,
            vehVal:basePrdInfo.vehVal,
            modelNm:basePrdInfo.modelNm
        });

        basePrdForm1 = liger.get("basePrdForm1");
        // car
        $("#isTk").hide();
        liger.get("isNew").setEnabled(true);

        var guidePc = (basePrdInfo.guidePc/100).toFixed(2);


        basePrdForm1.setData({
            /* prdSeries: carInfo.prdSeries, */
            carLen: basePrdInfo.carLen,
            prdYr: basePrdInfo.prdYr,
            prdCyCd: basePrdInfo.prdCyCd,
            outVol: basePrdInfo.outVol,
            grboxTypCd: basePrdInfo.grboxTypCd,
            grboxCfg: basePrdInfo.grboxCfg,
            seatQtyCd: basePrdInfo.seatQtyCd,
            engMdl: basePrdInfo.engMdl,
            drvTypCd: basePrdInfo.drvTypCd,
            carStrcCd: basePrdInfo.carStrcCd,
            carStrcCfg: basePrdInfo.carStrcCfg,
            powerTypCd: basePrdInfo.powerTypCd,
            guidePc :basePrdInfo.guidePc,
            mfrGuidePc: basePrdInfo.basePrdInfo,
            maxSpd: basePrdInfo.maxSpd,
            prdWayCd: basePrdInfo.prdWayCd,
            carMdl: basePrdInfo.carMdl,
            othCfg: basePrdInfo.othCfg,
            carVol: basePrdInfo.carVol,
            extMil: basePrdInfo.extMil,
            batDeg: basePrdInfo.batDeg,
			batBrand: basePrdInfo.batBrand,
            emiStdCd:basePrdInfo.emiStdCd,
            prdId:basePrdInfo.prdId,
            prdLvlCd:basePrdInfo.prdLvlCd
        });


        basePrdForm1 = liger.get("basePrdForm1");
        // TK
        basePrdForm1.setData({
            prdId: basePrdInfo.prdId,
            drvTyp: basePrdInfo.drvTyp,
            engMdl: basePrdInfo.engMdl,
            hp: basePrdInfo.hp,
            emiStd: basePrdInfo.emiStd,
            cabSpec: basePrdInfo.cabSpec,
            grboxMdl: basePrdInfo.grboxMdl,
            rearAxleSpec: basePrdInfo.rearAxleSpec,
            mWhlSpec: basePrdInfo.mWhlSpec,
            guidePc :basePrdInfo.guidePc,
            cntrSz: basePrdInfo.cntrSz,
            actCntrSz: basePrdInfo.actCntrSz,
            thickness: basePrdInfo.thickness,
            axleInfo: basePrdInfo.axleInfo,
            prdMdl: basePrdInfo.prdMdl,
            matQalCd: basePrdInfo.matQalCd,
            liftWayCd: basePrdInfo.liftWayCd,
            doorInfo: basePrdInfo.doorInfo,
            isHvWhl: basePrdInfo.isHvWhl,
            trlWhlSpec: basePrdInfo.trlWhlSpec,
            cylSepc: basePrdInfo.cylSepc,
            tankVol: basePrdInfo.tankVol,
            othInfo: basePrdInfo.othInfo,
            prdId:basePrdInfo.prdId,

			gasCylSpec:basePrdInfo.gasCylSpec,
			saddleSpec:basePrdInfo.saddleSpec,
			isHvAirCnd:basePrdInfo.isHvAirCnd,
			whlBase:basePrdInfo.whlBase,
			isHvSub:basePrdInfo.isHvSub,
			batDeg:basePrdInfo.batDeg,
			batBrand: basePrdInfo.batBrand,
			seatRowCd:basePrdInfo.seatRowCd,
			clsExfPc:basePrdInfo.clsExfPc,
			mOthInfo:basePrdInfo.mOthInfo,
			fuelTypCd:basePrdInfo.fuelTypCd,
			tvlMil:basePrdInfo.mil
		});
        basePrdForm1 = liger.get("basePrdForm1");
        basePrdForm1.setData({
            parkingLot: basePrdInfo.parkingLot,
            classNm: basePrdInfo.classNm,
            vehCheckCodeNm: basePrdInfo.vehCheckCodeNm,
            vehCheckCode: basePrdInfo.vehCheckCode,
            surveyorNm: basePrdInfo.surveyorNm,
            vehValNew: basePrdInfo.vehValNew,
            gerrBoxBrand:basePrdInfo.gerrBoxBrand,
            styleEngine:basePrdInfo.styleEngine,
            licDt:basePrdInfo.licDtStr,
            vin:basePrdInfo.vin,
            licNo:basePrdInfo.licNo,
            styleEngine:basePrdInfo.styleEngine,
            gerrBoxBrand:basePrdInfo.gerrBoxBrand

        });
		if(liger.get("drvTypCd")&&liger.get("drvTypCd")!="undefined"){
			liger.get("drvTypCd").setValue(basePrdInfo.drvTyp);
		}
		var drvTyp = basePrdInfo.drvTyp;
		if(plcyTcode==ProjectConstant.PRD_PLCY_CD_C0011&&drvTyp=="8×4"){
			$("#hp").attr("validate","{required:true}");
			var hpReq = $("#hpReq").text();
			if(!hpReq){
				var hpHtml = '<span class="requiredSymbol"  id="hpReq">*</span>';
				$("#hp").parent().append(hpHtml);
			}else{
				$("#hpReq").show();
			}
		}else{
			$("#hp").attr("validate","");
			$("#hpReq").hide();
		}
		if(basePrdInfo.vehVal){
            var vehVal = (parseFloat(basePrdInfo.vehVal)).toFixed(2);
            $("#vehVal").val(vehVal);
            $("#vehValNew").val(vehVal);
        }

        $("#prdDtlId").val(prdDetailId);
        $("#mfrId").val(basePrdInfo.mfrId);
        $("#brCd").val(basePrdInfo.brCd);
        $("#prdId").val(basePrdInfo.id);
        $("#vehCheckCode").val(basePrdInfo.vehCheckCode);
        var guidePc = $("#guidePc").val();
        var prdQty = $("#prdQty").val();
        if(prjTypCd==ProjectConstant.PRJ_TYP_CD_CDDYWUL||prjTypCd==ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd==ProjectConstant.PRJ_TYP_CD_OWNJYD){
			$("#guidePc").val(insGuidPc);
			guidePc = insGuidPc;
		}
        if(guidePc&&prdQty){
            //设置小计值
            guidePcChange();
        }

        setUsedPdShow()
    }

   /* function setData(basePrdInfo){

        var basePrdForm1 = liger.get("basePrdForm1");
        if(StringUtils.isNotEmpty(basePrdInfo.ctrValue)){
            if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
                liger.get("prdQty").setDisabled(true);
            }
            basePrdForm1.setData({
                prdQty: basePrdInfo.ctrValue
            });
        }else{
            basePrdForm1.setData({
                prdQty: 1
            });
        }
        basePrdForm1.setData({
            modelNm:basePrdInfo.modelName,
            carStyleName:basePrdInfo.carStyleName,
            styleId:basePrdInfo.styleId,
            productionCompany:basePrdInfo.productionCompany,
            prdNm: basePrdInfo.prdNm,
            prdClsCdNm: basePrdInfo.prdClsCdNm,
            prdClsCd: basePrdInfo.prdClsCd,
            prdCd: basePrdInfo.prdCd,
            prdTypCd: basePrdInfo.prdTypCd,
            brCdNm:basePrdInfo.brCdNm,
            brCd: basePrdInfo.brCd,
            prdMdl: basePrdInfo.prdMdl,
            prdMdlSun:basePrdInfo.prdMdl,
            secUsedPd :basePrdInfo.usedPd ,
            mfrId: basePrdInfo.mfrId,
            mfrNm: basePrdInfo.mfrNm,
            guidePc :basePrdInfo.guidePcDouble,
            prdRem: basePrdInfo.prdRem,
            audStsCd: basePrdInfo.audStsCd,
            prdTypCdNm: basePrdInfo.prdTypCdNm,
            prdId:basePrdInfo.id,
            carSourceId:basePrdInfo.carSourceId,
            carNo:basePrdInfo.carNo,
            vechCode:basePrdInfo.vehCheckCode,
        });

        basePrdForm1 = liger.get("basePrdForm1");
        // car
        $("#isTk").hide();
        liger.get("isNew").setEnabled(true);

        var guidePc = (basePrdInfo.guidePc/100).toFixed(2);


        basePrdForm1.setData({
            /!* prdSeries: carInfo.prdSeries, *!/
            carLen: basePrdInfo.carLen,
            prdYr: basePrdInfo.prdYr,
            prdCyCd: basePrdInfo.prdCyCd,
            outVol: basePrdInfo.outVol,
            grboxTypCd: basePrdInfo.grboxTypCd,
            grboxCfg: basePrdInfo.grboxCfg,
            seatQtyCd: basePrdInfo.seatQtyCd,
            engMdl: basePrdInfo.engMdl,
            drvTypCd: basePrdInfo.drvTypCd,
            carStrcCd: basePrdInfo.carStrcCd,
            carStrcCfg: basePrdInfo.carStrcCfg,
            powerTypCd: basePrdInfo.powerTypCd,
            guidePc :guidePc,
            maxSpd: basePrdInfo.maxSpd,
            prdWayCd: basePrdInfo.prdWayCd,
            carMdl: basePrdInfo.carMdl,
            othCfg: basePrdInfo.othCfg,
            carVol: basePrdInfo.carVol,
            extMil: basePrdInfo.extMil,
            batDeg: basePrdInfo.batDeg,
            emiStdCd:basePrdInfo.emiStdCd,
            prdId:basePrdInfo.prdId,
            prdLvlCd:basePrdInfo.prdLvlCd
        });


        basePrdForm1 = liger.get("basePrdForm1");
        // TK
        basePrdForm1.setData({
            prdId: basePrdInfo.prdId,
            drvTyp: basePrdInfo.drvTyp,
            engMdl: basePrdInfo.engMdl,
            hp: basePrdInfo.hp,
            emiStd: basePrdInfo.emiStd,
            cabSpec: basePrdInfo.cabSpec,
            grboxMdl: basePrdInfo.grboxMdl,
            rearAxleSpec: basePrdInfo.rearAxleSpec,
            mWhlSpec: basePrdInfo.mWhlSpec,
            guidePc :guidePc,
            cntrSz: basePrdInfo.cntrSz,
            actCntrSz: basePrdInfo.actCntrSz,
            thickness: basePrdInfo.thickness,
            axleInfo: basePrdInfo.axleInfo,
            prdMdl: basePrdInfo.prdMdl,
            matQalCd: basePrdInfo.matQalCd,
            liftWayCd: basePrdInfo.liftWayCd,
            doorInfo: basePrdInfo.doorInfo,
            isHvWhl: basePrdInfo.isHvWhl,
            trlWhlSpec: basePrdInfo.trlWhlSpec,
            cylSepc: basePrdInfo.cylSepc,
            tankVol: basePrdInfo.tankVol,
            othInfo: basePrdInfo.othInfo,
            prdId:basePrdInfo.prdId,

            gasCylSpec:basePrdInfo.gasCylSpec,
            saddleSpec:basePrdInfo.saddleSpec,
            isHvAirCnd:basePrdInfo.isHvAirCnd,
            whlBase:basePrdInfo.whlBase,
            isHvSub:basePrdInfo.isHvSub,
            batDeg:basePrdInfo.batDeg,
            seatRowCd:basePrdInfo.seatRowCd,
            clsExfPc:basePrdInfo.clsExfPc,
            mOthInfo:basePrdInfo.mOthInfo,
            surveyorId:basePrdInfo.surveyorId,
            surveyorNm:basePrdInfo.surveyorNm,
            parkingLot:basePrdInfo.parkingLot,
            licNo:basePrdInfo.licNo,
            fuelTypCd:basePrdInfo.fuelTypCd
        });
        if(liger.get("drvTypCd")&&liger.get("drvTypCd")!="undefined"){
            liger.get("drvTypCd").setValue(basePrdInfo.drvTyp);
        }
        var drvTyp = basePrdInfo.drvTyp;
        if(plcyTcode==ProjectConstant.PRD_PLCY_CD_C0011&&drvTyp=="8×4"){
            $("#hp").attr("validate","{required:true}");
            var hpReq = $("#hpReq").text();
            if(!hpReq){
                var hpHtml = '<span class="requiredSymbol"  id="hpReq">*</span>';
                $("#hp").parent().append(hpHtml);
            }else{
                $("#hpReq").show();
            }
        }else{
            $("#hp").attr("validate","");
            $("#hpReq").hide();
        }

        $("#prdDtlId").val(prdDetailId);
        $("#mfrId").val(basePrdInfo.mfrId);
        $("#brCd").val(basePrdInfo.brCd);
        $("#prdId").val(basePrdInfo.id);
        var guidePc = $("#guidePc").val();
        var prdQty = $("#prdQty").val();
        if(guidePc&&prdQty){
            //设置小计值
            guidePcChange();
        }

        setUsedPdShow()
    }*/

    //取消
    function cancelBtn(){
        var TAB=top.mainApp.parentTab;
        var currentTabid=TAB.getSelectedTabItemID();
        top.tab.removeTabItem(currentTabid);
    }

    function savePrjBscInfo(){
		var purchaseFee = $("#rsrvPc").val();
		console.log("保存按钮，每台设备留购价的金额:" + purchaseFee);
		// 当保存的时候，会校验【当机构为浙银的时候，每台设备留购价 字段 必须为0，不为0，报留购价错误】
		// 机构为浙银金租
		if(ProjectConstant.PRJ_INS_CODE_ZYFL == insCode) {
			if (purchaseFee != 0) {
				top.$.ligerDialog.SQalert({content: "留购价必须为0，请修改", SQ_type: "warning"});
				return false;
			}
		}

			var isBckNo = $("#isBckNo").val();
			var splBackBankNo = $("#splBackBankNoId").val();
			if (isBckNo == '1' && (splBackBankNo == null || splBackBankNo == '')) {
				$.ligerDialog.SQalert({content: "请选择供应商返利账号",SQ_type: "warning"});
				return false;
			}
			var isSalBckNo = $("#isSalBckNo").val();
			var salBackBankNo = $("#salBackBankNoId").val();
			if (isSalBckNo == '1' && (salBackBankNo == null || salBackBankNo == '')) {
				$.ligerDialog.SQalert({content: "请选择销售返利账号",SQ_type: "warning"});
				return false;
			}
			var splMfrId = $("#splMfrId").val();
			if ('1' == isSplMfr && ('' == splMfrId || null == splMfrId)) {
				$.ligerDialog.SQalert({content: "请选择厂商",SQ_type: "warning"});
				return false;
			}
			if (prjTypCd != 'CDDYWYQ') {
				var ligerForm = liger.get("basePrdForm1");
				if (!ligerForm.valid()) {
					top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
					return false; //验证不通过，不执行以下代码
				}

				var receiveTypeCd = $("#receiveTypeCd").val();
				if (receiveTypeCd == ProjectConstant.RECEIVE_TYPE_CD_SPL) {
					if (StringUtils.isEmpty($("#splId").val()) || StringUtils.isEmpty($("#splAccNoId").val())) {
						top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
						return false; //验证不通过，不执行以下代码
					}
				} else if (ProjectConstant.RECEIVE_TYPE_CD_SPL || ProjectConstant.RECEIVE_TYPE_CD_CZR) {
					if (StringUtils.isEmpty($("#cstSplId").val()) || StringUtils.isEmpty($("#cstSplAccNoId").val())) {
						top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
						return false; //验证不通过，不执行以下代码
					}
				}

				var isNew = $("#isNew").val();
				var certDt = $("#certDt").val();
				if ('0' == isNew && ('' == certDt || null == certDt)) {
					top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
					return false; //验证不通过，不执行以下代码
				}
			}
			var vehCheckCode = $("#vehCheckCode").val();
			if ('0' == isNew && ('' == vehCheckCode || null == vehCheckCode ||'0' == vehCheckCode)) {
				top.$.ligerDialog.SQalert({content: "请核实车源库验车方式！",SQ_type: "warning"});
				return false; //验证不通过，不执行以下代码
			}
			if (buOrgCd == ProjectConstant.CODE_BU_ORG_CD_XNY && prjTypCd == 'CPYW') {
				var isAdvLic = $("#isAdvLic").val();
				var advLicTm = $("#advLicTm").val();
				if (' ' == isAdvLic || null == isAdvLic) {
					top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
					return false;
				}
				if ('1'==isAdvLic && ('' == advLicTm || null == advLicTm)) {
					top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
					return false;
				}
			}


			var guidePc = $("#guidePc").ligerGetTextBoxManager().getValue();
			var prdQty = $("#prdQty").ligerGetTextBoxManager().getValue();
			var prdbscInfoId = $("#prdbscInfoId").val();
			var rsrvPc = $("#rsrvPc").val();
			var vehVal = $("#vehVal").val();
			var custFina = $("#custFina").val();

			if((buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK)&&((prjTypCd==ProjectConstant.PRJ_TYP_CD_CDDYWUL)||(prjTypCd==ProjectConstant.PRJ_TYP_CD_ESCJYD) || prjTypCd==ProjectConstant.PRJ_TYP_CD_OWNJYD)){
				if(vehVal!=beforeVehVal||custFina!=beforeCustFina||rsrvPc!=beforeRsrvPc){
					var _ids = [];
					_ids.push(prdbscInfoId);
					var params = {};
					params.prjId=prjId;
					params.ids = JSON.stringify(_ids);
					// 查询支付表是否存在
					$.ajax({
						type: 'get',
						dataType:'json',
						data:params,
						url: '<%=path%>/project/prjprdbscinfo/checkPrjPrdDtlExist.do',
						success:function(msg){
							if(msg.data==true){
								$.ligerDialog.SQalert({
									SQ_showButtons: true,
									SQ_onBtnclick: function (item, Dialog) {
										$("#removeFlag").val(CommonConstant.C_YN_Y);
										save();
									},
									content: "已经存在支付表信息，确定删除已经拆分的支付表,修改客户融资额、车辆估值和指导价信息吗？"
								});
							}else{
								$("#removeFlag").val(CommonConstant.C_YN_N);
								save();
							}

						}

					});


				}else{
					$("#removeFlag").val(CommonConstant.C_YN_N);
					save();
				}


			}else{
				if(guidePc&&prdQty&&prdbscInfoId&&rsrvPc){
					if(guidePc!=beforeGuidePc||beforePrdQty!=prdQty||rsrvPc!=beforeRsrvPc){
						var _ids = [];
						_ids.push(prdbscInfoId);
						var params = {};
						params.prjId=prjId;
						params.ids = JSON.stringify(_ids);
						// 查询支付表是否存在
						$.ajax({
							type: 'get',
							dataType:'json',
							data:params,
							url: '<%=path%>/project/prjprdbscinfo/checkPrjPrdDtlExist.do',
							success:function(msg){
								if(msg.data==true){
									$.ligerDialog.SQalert({
										SQ_showButtons: true,
										SQ_onBtnclick: function (item, Dialog) {
											$("#removeFlag").val(CommonConstant.C_YN_Y);
											save();
										},
										content: "已经存在支付表信息，确定删除已经拆分的支付表,修改数量和指导价信息吗？"
									});
								}else{
									$("#removeFlag").val(CommonConstant.C_YN_N);
									save();
								}

							}

						});


					}else{
						$("#removeFlag").val(CommonConstant.C_YN_N);
						save();
					}
				}else{
					$("#removeFlag").val(CommonConstant.C_YN_N);
					save();
				}
			}
	}

    //保存项目基础信息
    function save(){
        var ligerForm = liger.get("basePrdForm1");
        if (!ligerForm.valid()) {
            top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }

		var splNm = $("#splId").val();
		var recommendSplNm = $("#recommendSplId").val();
		var guaranteePaymentNm = $("#guaranteePaymentId").val();
		//var compensatorySplNm = $("#compensatorySplId").val();
		var cstSplNm = $("#cstSplId").val();
        var data = ligerForm.getData();
        var prjId = '${prjId}';
        var prdCd = '${pCd}';
        var isNew = $("#isNew").val();
        var rcCstBscInfoId = _rcCstBscInfoId;
        var receiveTypeCd = $("#receiveTypeCd").val();
        var guaranteePaymentType = $("#guaranteePaymentType").val();

        if(isNew=="1"&&$("#prdbscInfoId").val()){
            //设置二手车相应的字段为空
            data["invAmt"] = 0;
            data["certDt"] = null;
            data["usedPd"] = 0;
            data["deprRate"] = 0;
            data["deprAmt"] = 0;
            data["vehCheckCode"] = null;
        }
        data["guidePcEditFlag"] = guidePcEditFlag;
        data["prjId"] = prjId;
        data["prdCd"] = prdCd;
		data["splNm"] = splNm;
		data["recommendSplNm"] = recommendSplNm;
		data["guaranteePaymentNm"] = guaranteePaymentNm;
		//data["compensatorySplNm"] = compensatorySplNm;
        data["styleId"] = "${styleId}";
        data["carSourceId"] = "${carSourceId}";
        data["carId"] = $("#carId").val();
        data["tkId"] = $("#tkId").val();
        data["mfrId"]=$("#mfrId").val();
        data["prdId"]=$("#prdId").val();
        data["prdDtlId"]=$("#prdDtlId").val();
        data["prdQty"]=$("#prdQty").val();
        data["vehCheckCode"]=$("#vehCheckCode").val();
        //data["prdbscInfoId"] = $("#prdbscInfoId").val();
		data["prdbscInfoId"] = "${id}";
        data["removeFlag"] = $("#removeFlag").val();
        data["rcCstBscInfoId"] = rcCstBscInfoId;
        // data["splMfrId"] = $("#splMfrId").ligerComboBox().getValue();
        data["mfrGuidePc"] = "";//厂商指导价不入库
        data["splMfrNm"] = $("#splMfrId").val();
        data["prdTypCd"] = prdTypCd;

        //挂靠公司信息
		data["lnkCompId"] = $("#lnkCompId").val();
		data["lnkCompNm"] = $("#lnkCompNm").val();
		data["lnkCompType"] = $('input:radio[name="lnkCompType"]:checked').val();
		data["lnkCompMsg"] = $("#lnkCompMsg").val();
		data["lnkStartLvl"] = $("#lnkStartLvl").val();
        if (buOrgCd == ProjectConstant.CODE_BU_ORG_CD_XNY && prjTypCd == 'CPYW'){
        	data["isAdvLic"] = $("#isAdvLic").val();
        	if (data["isAdvLic"] == "1"){
        		data["advLicTm"] = $("#advLicTm").val();
			}
		}
        // 如果选择了客车  验证是否有车身长度，如果没有则不允许保存
        if(prdTypCd){
            if(prdTypCd == "52"){
                var carLen = $("#carLen").val();
                if(!carLen){
                    UIUtils.alertError("缺少车身长度信息，不能保存!");
                    return false;
                }
            }
        }

		var accNoArr = [];
		var accNo1 = {};
		if (prjTypCd != 'CDDYWYQ') {
			if (receiveTypeCd != ProjectConstant.RECEIVE_TYPE_CD_SPL) {
				accNo1.splAccNoId = $("#cstSplAccNoId").ligerComboBox().getValue();
				accNo1.purpCd = 1;
				accNoArr.push(accNo1);
			} else {
				accNo1.splAccNoId = $("#splAccNoId").ligerComboBox().getValue();
				accNo1.purpCd = 1;
				accNoArr.push(accNo1);
				var backNo = $("#splBackBankNoId").val();
				if (backNo) {
					var accNo2 = {};
					accNo2.splAccNoId = $("#splBackBankNoId").ligerComboBox().getValue();
					accNo2.purpCd = 2;
					accNoArr.push(accNo2);
				}
			}
		}
		//返利账号
		var  salBackAccNo = $("#salBackBankNoId").val();
		if(salBackAccNo){
			var accNo3 = {};
			accNo3.splAccNoId=$("#salBackBankNoId").ligerComboBox().getValue();
			accNo3.purpCd = 11;
			accNoArr.push(accNo3);
		}
        if (prjTypCd == 'CDDYWYQ') {
            receiveTypeCd = "2";//疫情项目默认是承租人
			cstSplNm = $("#yqCstSplId").val();
            accNoArr = [];
            accNo1.splAccNoId=$("#yqSplAccNoId").val();
            accNo1.purpCd = 1;
            accNoArr.push(accNo1);
        }
        //代偿担保账号
		//if (buOrgCd== '00000001' && (prjTypCd == 'CPYW' || prjTypCd == 'CTYW')) {
		//经销商代偿担保账号
		if (compensatoryType == '1' && guaranteePaymentType == '1') {
			var compensatorySplAccNoId = $("#compensatorySplAccNoId").ligerComboBox().getValue();
			var accNo4 = {};
			accNo4.splAccNoId = compensatorySplAccNoId;
			accNo4.purpCd = 14;
			accNoArr.push(accNo4);
		}
		//挂靠公司代偿担保账号
		if (compensatoryType == '1' && guaranteePaymentType == '2') {
			var compensatorySplAccNoId = $("#compensatorySplAccNoId").ligerComboBox().getValue();
			var accNo4 = {};
			accNo4.splAccNoId = compensatorySplAccNoId;
			accNo4.purpCd = 4;
			accNoArr.push(accNo4);
		}
		//经销商保证金担保账号
		if (compensatoryType == '2' && guaranteePaymentType == '1') {
			var depositSplAccNoId = $("#depositSplAccNoId").ligerComboBox().getValue();
			console.log(depositSplAccNoId);
			var accNo4 = {};
			accNo4.splAccNoId = depositSplAccNoId;
			accNo4.purpCd = 15;
			accNoArr.push(accNo4);
		}
		//挂靠公司保证金担保账号
		if (compensatoryType == '2' && guaranteePaymentType == '2') {
			var depositSplAccNoId = $("#depositSplAccNoId").ligerComboBox().getValue();
			var accNo4 = {};
			accNo4.splAccNoId = depositSplAccNoId;
			accNo4.purpCd = 3;
			accNoArr.push(accNo4);
		}
		data["cstSplNm"] = cstSplNm;
		data["receiveTypeCd"]=receiveTypeCd;
		data["bankAccNoList"]=JSON.stringify(accNoArr);
		data["licenseCd"]=$("#licenseCd").val();
		data["insRoutePrdId"]=insRoutePrdId;
		console.log(JSON.stringify(data));
		var url = '<%=path%>/project/vehicle/addPrdAndPrdDetail.do';
		//换车-新增项目产品时，调用新的接口
		if (prjPrdChangeFlag == "true") {
			data["paySchId"] = paySchId;
			data["paySchNo"] = paySchNo;
			data["oldDtlId"] = oldDtlId;
			url = '<%=path%>/project/vehicle/savePrdAndPrdDetailByHC.do';
		}
		var wait_dialog;
		$.ajax({
			type: 'post',
			dataType:'json',
			data:data,
			url: url,
			beforeSend: function(){
				wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
			},
			success:function(msg){
				if(msg.success == 1){
					wait_dialog.close();
					top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
					var TAB=top.mainApp.parentTab;
					var currentTabid=TAB.getSelectedTabItemID();
                    TAB.reload(currentTabid);
					var currFrameElement=top.$("#"+currentTabid).get(0);
					var callback=currFrameElement.W2W.callback;
					callback();
					top.tab.removeTabItem(currentTabid);
				}else{
					wait_dialog.close();
					UIUtils.alertError(msg.info);
				}
			}
		});
	}


    var comboGrid_defaultValue2='${accId}';
    var comboGrid_defaultText2 = '${accNo}';
    var isInit_setSearchComboVal2 = false;
    var rcptUnt;
    var count = 0;
    // 供应商账号下拉框
	function getSplBankNo() {
		if($("#receiveTypeCd").val() != ProjectConstant.RECEIVE_TYPE_CD_SPL){
			comboGrid_defaultValue2 = '';
			comboGrid_defaultText2 = '';
		}
		var splId =liger.get("splId").selectedValue;
		var bankId='${accId}';
		var audStsCdList = new Array();
		audStsCdList.push(CommonConstant.C_AUD_NO_HAPPEN_CODE);
		if(buOrgCd!=ProjectConstant.CODE_BU_ORG_CD_CAR){
			audStsCdList.push(CommonConstant.C_AUD_ADNWAY_CODE);
		}
		audStsCdList.push(CommonConstant.C_AUD_PASS_CODE);
		var audStsCdListArr = JSON.stringify(audStsCdList);
		if(COMBO_BANK && COMBO_BANK.gridManager) {
            COMBO_BANK.grid.loadServerData($.extend(true, {condition: JSON.stringify(rcptUnt)}, {'splId': splId}));
			return;
        }
        COMBO_BANK=$("#splAccNoId").ligerComboBox({
			width: 300,
			selectBoxWidth: 430,
			selectBoxHeight: 240,
			valueField: 'id',
			textField: 'accNo',
			isSingleCheck: true,
            condition: {
                labelWidth: 0,
                space: 5,
                fields: [{ name: 'rcptUnt', width: 90, type:'text' , keyName: 'id'}]

            },
            conditionSearchClick: function (a) {
			    if (a.rules.length == 0) {
                    rcptUnt = '';
				} else {
                    rcptUnt = a.rules[0].value;
				}
                COMBO_BANK.grid.options.newPage = 1;
                COMBO_BANK.grid.loadServerData({'rcptUnt': rcptUnt, 'splId': liger.get("splId").selectedValue, 'page' : '1'});
			},
			grid: getSplBankNoGridOptions(true, audStsCdListArr, bankId),

			delayLoadGrid: false
		});
	}

	// 获取供应商账号的列表
	function getSplBankNoGridOptions(checkbox, audStsCdListArr, bankId){
		var options = {
			url: '<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do?purpCd=1' + '&audStsCdList=' + audStsCdListArr + '&compensatoryType=' + compensatoryType,
			columns: [
				{ display: 'id', name: 'id', minWidth: 150,hide:true },
				{ display: '收款人', name: 'rcptUnt',
					render: function (rowdata, rowindex, value, column) {
						value ==null?"":value;
						var h = '';
						if(rowdata.audStsCd){
							if(rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_NON||rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_IN){
								h+='<i class="ico_flasher"></i>';
							}
						}
						h+=value;
						return h;
					},
					minWidth: 150 },
				{ display: '对公/对私', name: 'bizTypCdNm', minWidth: 50, width: 60 },
				{ display: '收款账号', name: 'accNo', minWidth: 150 },
				{ display: '开户银行', name: 'bkNm', minWidth: 150 },
				{ display: '开户行号', name: 'bkNo', minWidth: 50 }

            ],
            method: 'get',
            data:null,
            dataAction: 'server',
            root:'rows',
            record:'total',
            pageSize: 10,
            cssClass: "SMALL_grid",
            isSingleCheck: true,
            frozen: false,
            isSelected: function (rowdata) {
                if (comboGrid_defaultValue2 == "") return false;
                var defaultItems = comboGrid_defaultValue2.split(";");
                if(!isInit_setSearchComboVal2) { //只在初始化时执行一次，在onAfterShowData后改变
                    for (var i = 0; i < defaultItems.length; i++) {
                        if(rowdata[COMBO_BANK.options.valueField] == defaultItems[i]) {
                            return true;
                        }
                    };
                };
                return false;
            },
            onAfterShowData: function (currentData) {
                if(!isInit_setSearchComboVal2 && count < 1) { //只在初始化时执行一次，在onAfterShowData后改变
                    //COMBO_BANK.setInputValue(comboGrid_defaultValue2, comboGrid_defaultText2, true);
					//解决因加载顺序问题不会回显的问题
					setTimeout(function () {
						COMBO_BANK.setInputValue(accIdVal, comboGrid_defaultText2, true);
						// isInit_setSearchComboVal2 = true;
						count ++;
					},1000);
				}
            },
			onChangePage: function (page) {
                COMBO_BANK.grid.options.newPage = page;
                COMBO_BANK.grid.setParm('splId', liger.get("splId").selectedValue);
                COMBO_BANK.grid.setParm('rcptUnt', rcptUnt);
			}
        };
        return options;
    }

	var comboGrid_defaultValue10='${compensatorySplAccNoId}';
	var comboGrid_defaultText10 = '${compensatorySplAccNoNm}';
	console.log(comboGrid_defaultText10);
	var isInit_setSearchComboVal10 = false;
	var rcptUnt10;
	var count10 = 0;
	// 供应商账号下拉框
	function getCompensatorySplBankNo() {
		if($("#receiveTypeCd").val() != ProjectConstant.RECEIVE_TYPE_CD_SPL){
			comboGrid_defaultValue10 = '';
			comboGrid_defaultText10 = '';
		}
		var guaranteePaymentId =$('#guaranteePaymentId_val').val();
		console.log(guaranteePaymentId + 'guaranteePaymentId');
		var bankId='${compensatorySplAccNoId}';
		var audStsCdList = new Array();
		audStsCdList.push(CommonConstant.C_AUD_PASS_CODE);
		var audStsCdListArr = JSON.stringify(audStsCdList);
		if(COMPENSATORY_COMBO_BANK && COMPENSATORY_COMBO_BANK.gridManager) {
			var guaranteePaymentType = document.getElementById("guaranteePaymentType").value;
			if(guaranteePaymentType == '1'){
				COMPENSATORY_COMBO_BANK.grid.options.url='<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do?purpCd=14' + '&audStsCdList=' + audStsCdListArr + '&compensatoryType=' + compensatoryType;
				COMPENSATORY_COMBO_BANK.grid.loadServerData($.extend(true, {condition: JSON.stringify(rcptUnt10)}, {'splId': guaranteePaymentId}));
			}
			if(guaranteePaymentType == '2'){
				COMPENSATORY_COMBO_BANK.grid.options.url='<%=path%>/project/prjlnkcomp/queryBankList.do?purpCd=4'  + '&compensatoryType=' + compensatoryType;
				COMPENSATORY_COMBO_BANK.grid.loadServerData($.extend(true, {condition: JSON.stringify(rcptUnt10)}, {'lnkCompId': guaranteePaymentId}));
			}
			return;
		}
		COMPENSATORY_COMBO_BANK=$("#compensatorySplAccNoId").ligerComboBox({
			width: 300,
			selectBoxWidth: 430,
			selectBoxHeight: 240,
			valueField: 'id',
			textField: 'accNo',
			isSingleCheck: true,
			condition: {
				labelWidth: 0,
				space: 5,
				fields: [{ name: 'rcptUnt', width: 90, type:'text' , keyName: 'id'}]

			},
			conditionSearchClick: function (a) {
				if (a.rules.length == 0) {
					rcptUnt10 = '';
				} else {
					rcptUnt10 = a.rules[0].value;
				}
				COMPENSATORY_COMBO_BANK.grid.options.newPage = 1;
				guaranteePaymentId =liger.get("guaranteePaymentId").selectedValue;
				var guaranteePaymentType = document.getElementById("guaranteePaymentType").value;
				if(guaranteePaymentType == '1'){
					COMPENSATORY_COMBO_BANK.grid.loadServerData({'rcptUnt': rcptUnt10, 'splId': guaranteePaymentId, 'page' : '1'});
				}
				if(guaranteePaymentType == '2'){
					COMPENSATORY_COMBO_BANK.grid.loadServerData({'rcptUnt': rcptUnt10, 'lnkCompId': guaranteePaymentId, 'page' : '1'});
				}
			},
			grid: getCompensatorySplBankNoGridOptions(true, audStsCdListArr, bankId),

			delayLoadGrid: false
		});
	}

	// 获取代偿担保账号的列表
	function getCompensatorySplBankNoGridOptions(checkbox, audStsCdListArr, bankId){
		var url = "";
		var guaranteePaymentType = document.getElementById("guaranteePaymentType").value;
		if(guaranteePaymentType == '1'){
			url = '<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do?purpCd=14' + '&audStsCdList=' + audStsCdListArr + '&compensatoryType=' + compensatoryType;
		}
		if(guaranteePaymentType == '2'){
			url = '<%=path%>/project/prjlnkcomp/queryBankList.do?purpCd=4'  + '&compensatoryType=' + compensatoryType;
		}
		var options = {
			url: url,
			columns: [
				{ display: 'id', name: 'id', minWidth: 150,hide:true },
				{ display: '收款人', name: 'rcptUnt',
					render: function (rowdata, rowindex, value, column) {
						value ==null?"":value;
						var h = '';
						if(rowdata.audStsCd){
							if(rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_NON||rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_IN){
								h+='<i class="ico_flasher"></i>';
							}
						}
						h+=value;
						return h;
					},
					minWidth: 150 },
				{ display: '对公/对私', name: 'bizTypCdNm', minWidth: 50, width: 60 },
				{ display: '收款账号', name: 'accNo', minWidth: 150 },
				{ display: '开户银行', name: 'bkNm', minWidth: 150 },
				{ display: '开户行号', name: 'bkNo', minWidth: 50 }

			],
			method: 'get',
			data:null,
			dataAction: 'server',
			root:'rows',
			record:'total',
			pageSize: 10,
			cssClass: "SMALL_grid",
			isSingleCheck: true,
			frozen: false,
			isSelected: function (rowdata) {
				if (comboGrid_defaultValue10 == "") return false;
				var defaultItems = comboGrid_defaultValue10.split(";");
				if(!isInit_setSearchComboVal10) { //只在初始化时执行一次，在onAfterShowData后改变
					for (var i = 0; i < defaultItems.length; i++) {
						if(rowdata[COMPENSATORY_COMBO_BANK.options.valueField] == defaultItems[i]) {
							return true;
						}
					};
				};
				return false;
			},
			onAfterShowData: function (currentData) {
				if(!isInit_setSearchComboVal10 && count < 1) { //只在初始化时执行一次，在onAfterShowData后改变
					COMPENSATORY_COMBO_BANK.setInputValue(comboGrid_defaultValue10, comboGrid_defaultText10, true);
					// isInit_setSearchComboVal2 = true;
					count10 ++;
				}
			},
			onChangePage: function (page) {
				console.log(page);
				COMPENSATORY_COMBO_BANK.grid.options.newPage = page;
				COMPENSATORY_COMBO_BANK.grid.setParm('splId', liger.get("splId").selectedValue);
				COMPENSATORY_COMBO_BANK.grid.setParm('rcptUnt', rcptUnt10);
			},
			onSelectRow:function(rowdata){
				liger.get('compensatorySplRcptUnt').setValue(rowdata.rcptUnt);
				liger.get('compensatorySplBkNm').setValue(rowdata.bkNm);
				liger.get('compensatorySplBkNo').setValue(rowdata.bkNo);
				return true;
			}
		};
		return options;
	}

	var comboGrid_defaultValue11='${depositSplAccNoId}';
	var comboGrid_defaultText11 = '${depositSplAccNoNm}';
	var isInit_setSearchComboVal11 = false;
	var rcptUnt11;
	var count11 = 0;
	// 担保主体下拉框
	function getDepositSplBankNo() {
		var guaranteePaymentId =$('#guaranteePaymentId_val').val();
		var bankId='${depositSplAccNoId}';
		var audStsCdList = new Array();
		audStsCdList.push(CommonConstant.C_AUD_PASS_CODE);
		var audStsCdListArr = JSON.stringify(audStsCdList);
		if(DEPOSIT_COMBO_BANK && DEPOSIT_COMBO_BANK.gridManager) {
			var guaranteePaymentType = document.getElementById("guaranteePaymentType").value;
			if(guaranteePaymentType == '1'){
				//DEPOSIT_COMBO_BANK.set({url:'<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do?purpCd=15' + '&audStsCdList=' + audStsCdListArr + '&compensatoryType=' + compensatoryType});
				DEPOSIT_COMBO_BANK.grid.options.url='<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do?purpCd=15' + '&audStsCdList=' + audStsCdListArr + '&compensatoryType=' + compensatoryType;
				DEPOSIT_COMBO_BANK.grid.loadServerData($.extend(true, {condition: JSON.stringify(rcptUnt11)}, {'splId': guaranteePaymentId}));
			}
			if(guaranteePaymentType == '2'){
				//DEPOSIT_COMBO_BANK.set({url:'<%=path%>/project/prjlnkcomp/queryBankList.do?purpCd=3'  + '&compensatoryType=' + compensatoryType});
				DEPOSIT_COMBO_BANK.grid.options.url='<%=path%>/project/prjlnkcomp/queryBankList.do?purpCd=3'  + '&compensatoryType=' + compensatoryType;
				DEPOSIT_COMBO_BANK.grid.loadServerData($.extend(true, {condition: JSON.stringify(rcptUnt11)}, {'lnkCompId': guaranteePaymentId}));
			}
			return;
		}
		DEPOSIT_COMBO_BANK=$("#depositSplAccNoId").ligerComboBox({
			width: 300,
			selectBoxWidth: 430,
			selectBoxHeight: 240,
			valueField: 'id',
			textField: 'accNo',
			isSingleCheck: true,
			condition: {
				labelWidth: 0,
				space: 5,
				fields: [{ name: 'rcptUnt', width: 90, type:'text' , keyName: 'id'}]

			},
			conditionSearchClick: function (a) {
				if (a.rules.length == 0) {
					rcptUnt11 = '';
				} else {
					rcptUnt11 = a.rules[0].value;
				}
				guaranteePaymentId =liger.get("guaranteePaymentId").selectedValue;
				var guaranteePaymentType = document.getElementById("guaranteePaymentType").value;
				DEPOSIT_COMBO_BANK.grid.options.newPage = 1;
				if(guaranteePaymentType == '1'){
					DEPOSIT_COMBO_BANK.grid.loadServerData({'rcptUnt': rcptUnt11, 'splId': guaranteePaymentId, 'page' : '1'});
				}
				DEPOSIT_COMBO_BANK.grid.options.newPage = 1;
				if(guaranteePaymentType == '2'){
					DEPOSIT_COMBO_BANK.grid.loadServerData({'rcptUnt': rcptUnt11, 'lnkCompId': guaranteePaymentId, 'page' : '1'});
				}
			},
			grid: getDepositSplBankNoGridOptions(true, audStsCdListArr, bankId),

			delayLoadGrid: false
		});
	}

	function getDepositSplBankNoGridOptions(checkbox, audStsCdListArr, bankId){
		// 获取保证金担保账号的列表
		// (根据担保主体类型 区分调用经销商账号或者挂靠公司账号)
		var url = "";
		var guaranteePaymentType = document.getElementById("guaranteePaymentType").value;
		if(guaranteePaymentType == '1'){
			url = '<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do?purpCd=15' + '&audStsCdList=' + audStsCdListArr + '&compensatoryType=' + compensatoryType;
		}
		if(guaranteePaymentType == '2'){
			url = '<%=path%>/project/prjlnkcomp/queryBankList.do?purpCd=3'  + '&compensatoryType=' + compensatoryType;
		}
		var options = {
			url: url,
			columns: [
				{ display: 'id', name: 'id', minWidth: 150,hide:true },
				{ display: '收款人', name: 'rcptUnt',
					render: function (rowdata, rowindex, value, column) {
						value ==null?"":value;
						var h = '';
						if(rowdata.audStsCd){
							if(rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_NON||rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_IN){
								h+='<i class="ico_flasher"></i>';
							}
						}
						h+=value;
						return h;
					},
					minWidth: 150 },
				{ display: '对公/对私', name: 'bizTypCdNm', minWidth: 50, width: 60 ,
					render: function (rowdata, rowindex, value, column) {
						if (rowdata.bizTypCd == '0') {
							return "对公";
						} else if (rowdata.bizTypCd == '1') {
							return "对私";
						}
					}
				},
				{ display: '收款账号', name: 'accNo', minWidth: 150 },
				{ display: '开户银行', name: 'bkNm', minWidth: 150 },
				{ display: '开户行号', name: 'bkNo', minWidth: 50 }

			],
			method: 'get',
			data:null,
			dataAction: 'server',
			root:'rows',
			record:'total',
			pageSize: 10,
			cssClass: "SMALL_grid",
			isSingleCheck: true,
			frozen: false,
			isSelected: function (rowdata) {
				if (comboGrid_defaultValue11 == "") return false;
				var defaultItems = comboGrid_defaultValue11.split(";");
				if(!isInit_setSearchComboVal11) { //只在初始化时执行一次，在onAfterShowData后改变
					for (var i = 0; i < defaultItems.length; i++) {
						if(rowdata[DEPOSIT_COMBO_BANK.options.valueField] == defaultItems[i]) {
							return true;
						}
					};
				};
				return false;
			},
			onAfterShowData: function (currentData) {
				if(!isInit_setSearchComboVal11 && count11 < 1) { //只在初始化时执行一次，在onAfterShowData后改变
					DEPOSIT_COMBO_BANK.setInputValue(comboGrid_defaultValue11, comboGrid_defaultText11, true);
					// isInit_setSearchComboVal2 = true;
					count11 ++;
				}
			},
			onChangePage: function (page) {
				console.log(page);
				DEPOSIT_COMBO_BANK.grid.options.newPage = page;
				DEPOSIT_COMBO_BANK.grid.setParm('splId', liger.get("splId").selectedValue);
				DEPOSIT_COMBO_BANK.grid.setParm('rcptUnt', rcptUnt11);
			},
			onSelectRow:function(rowdata){
				liger.get('depositSplRcptUnt').setValue(rowdata.rcptUnt);
				liger.get('depositSplBkNm').setValue(rowdata.bkNm);
				liger.get('depositSplBkNo').setValue(rowdata.bkNo);
				return true;
			}
		};
		return options;
	}

    //供应商返利账号
    function getSplBackBankNo(){
        var splId =liger.get("splId").selectedValue;
        if(splId==undefined||splId==''){
            return;
        }
        var backAccId='${backAccId}';
        var audStsCdList = new Array();
        audStsCdList.push(CommonConstant.C_AUD_NO_HAPPEN_CODE);
        if(buOrgCd!=ProjectConstant.CODE_BU_ORG_CD_CAR){
            audStsCdList.push(CommonConstant.C_AUD_ADNWAY_CODE);
        }
        audStsCdList.push(CommonConstant.C_AUD_PASS_CODE);
        var audStsCdListArr = JSON.stringify(audStsCdList);
        $.ajax({
            url: '<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do?splId='+splId+'&&audStsCdList='+audStsCdListArr+'&&purpCd=2',
            dataType:'json',
            success: function (res) {
                var splBackBankNoId = liger.get('splBackBankNoId');
                splBackBankNoId.gridManager.loadData(res);
                splBackBankNoId.clear();
                if(backAccId){
                    splBackBankNoId.setValue(backAccId);
                }
            }
        });
    }
    var comboGrid_defaultValue3='${backAccId}';
    var comboGrid_defaultText3 = '${backAccNo}';
    var isInit_setSearchComboVal3 = false;
    var COMBO_BACK_BANK = $("#splBackBankNoId").ligerComboBox({
        width: 300,
        selectBoxWidth: 430,
        selectBoxHeight: 240,
        valueField: 'id',
        textField: 'accNo',
        isMultiSelect: true,
        isSingleCheck: true,
        condition: {
            labelWidth: 0,
            space: 5,
            fields: [{ name: 'rcptUnt', width: 90, type:'text' , keyName: 'id'}]
        },
        grid: getSplBackBankNoGridOptions(true),
        delayLoadGrid: false
    });

	// 供应商返利账号下拉列表
	function getSplBackBankNoGridOptions(checkbox){
		if (prjTypCd != 'CDDYWYQ') {
			var splId = liger.get("splId").selectedValue;
		}
		var options = {
			columns: [
                { display: 'id', name: 'id', minWidth: 150,hide:true },
                { display: '收款人', name: 'rcptUnt',
                    render: function (rowdata, rowindex, value, column) {
                        value ==null?"":value;
                        var h = '';
                        if(rowdata.audStsCd){
                            if(rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_NON||rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_IN){
                                h+='<i class="ico_flasher"></i>';
                            }
                        }
                        h+=value;
                        return h;
                    },
                    minWidth: 150 },
                { display: '对公/对私', name: 'bizTypCdNm', minWidth: 50, width: 60 },
                { display: '收款账号', name: 'accNo', minWidth: 150 },
                { display: '开户银行', name: 'bkNm', minWidth: 150 },
                { display: '开户行号', name: 'bkNo', minWidth: 50 },

            ],
            switchPageSizeApplyComboBox: false,
            method: 'get',
            data:null,
            dataAction: 'local',
            root:'rows',
            record:'total',
            pageSize: 50,
            usePagerOnLessPagesize: false,
            cssClass: "SMALL_grid",
            // checkbox: checkbox,
            isSingleCheck: true,
            frozen: false,
            isSelected: function (rowdata) {
                if (comboGrid_defaultValue3 == "") return false;
                var defaultItems = comboGrid_defaultValue3.split(";");
                if(!isInit_setSearchComboVal3) { //只在初始化时执行一次，在onAfterShowData后改变
                    for (var i = 0; i < defaultItems.length; i++) {
                        if(rowdata[COMBO_BACK_BANK.options.valueField] == defaultItems[i]) {
                            return true;
                        }
                    };
                };
                return false;
            },
            onAfterShowData: function (currentData) {
                if(!isInit_setSearchComboVal3) { //只在初始化时执行一次，在onAfterShowData后改变
                    COMBO_BACK_BANK.setInputValue(comboGrid_defaultValue3, comboGrid_defaultText3, true);
                    isInit_setSearchComboVal3 = true;
                }
            }
        };
        return options;
    }


    //销售返利账号
    function getSalBackBankNo(){
        var salBackAccId='${salBackAccId}';
        var audStsCdList = new Array();
        audStsCdList.push(CommonConstant.C_AUD_NO_HAPPEN_CODE);
        if(buOrgCd!=ProjectConstant.CODE_BU_ORG_CD_CAR){
            audStsCdList.push(CommonConstant.C_AUD_ADNWAY_CODE);
        }
        audStsCdList.push(CommonConstant.C_AUD_PASS_CODE);
        var audStsCdListArr = JSON.stringify(audStsCdList);
        $.ajax({
            url: '<%=path%>/project/prjprdbscinfo/getSalBackBankNo.do?audStsCdList='+audStsCdListArr+'&accStsCd=VALID&prjId=' + prjId,
            dataType:'json',
            success: function (res) {
                var salBackBankNoId = liger.get('salBackBankNoId');
                salBackBankNoId.gridManager.loadData(res);
                salBackBankNoId.clear();
                if(salBackAccId){
                    salBackBankNoId.setValue(salBackAccId);
                }
            }
        });
    }

    var comboGrid_defaultValue5='${salBackAccId}';
    var comboGrid_defaultText5 = '${salBackAccNo}';
    var isInit_setSearchComboVal5 = false;
    var COMBO_SAL_BACK_BANK = $("#salBackBankNoId").ligerComboBox({
        width: 300,
        selectBoxWidth: 430,
        selectBoxHeight: 240,
        valueField: 'id',
        textField: 'accNo',
        isMultiSelect: true,
        isSingleCheck: true,
        condition: {
            labelWidth: 0,
            space: 5,
            fields: [{ name: 'rcptUnt', width: 90, type:'text' , keyName: 'id'}]
        },
        grid: getSalBankNoGridOptions(true),
        delayLoadGrid: false
    });

    // 销售返利账号下拉列表
    function getSalBankNoGridOptions(checkbox){
        var options = {
            columns: [
                { display: 'id', name: 'id', minWidth: 150,hide:true },
                { display: '收款人', name: 'rcptUnt',
                    render: function (rowdata, rowindex, value, column) {
                        value ==null?"":value;
                        var h = '';
                        if(rowdata.audStsCd){
                            if(rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_NON||rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_IN){
                                h+='<i class="ico_flasher"></i>';
                            }
                        }
                        h+=value;
                        return h;
                    },
                    minWidth: 150 },
                { display: '对公/对私', name: 'bizTypCd', minWidth: 50, width: 60,
                    render: function (rowdata, rowindex, value, column) {
                        if (rowdata.bizTypCd == '0') {
                            return "对公";
                        } else if (rowdata.bizTypCd == '1') {
                            return "对私";
                        }
					}
                },
                { display: '收款账号', name: 'accNo', minWidth: 150 },
                { display: '开户银行', name: 'bkNm', minWidth: 150 },
                { display: '开户行号', name: 'bkNo', minWidth: 50 },

            ],
            switchPageSizeApplyComboBox: false,
            method: 'get',
            data:null,
            dataAction: 'local',
            root:'rows',
            record:'total',
            pageSize: 50,
            usePagerOnLessPagesize: false,
            cssClass: "SMALL_grid",
            // checkbox: checkbox,
            isSingleCheck: true,
            frozen: false,
            isSelected: function (rowdata) {
                if (comboGrid_defaultValue5 == "") return false;
                var defaultItems = comboGrid_defaultValue5.split(";");
                if(!isInit_setSearchComboVal5) { //只在初始化时执行一次，在onAfterShowData后改变
                    for (var i = 0; i < defaultItems.length; i++) {
                        if(rowdata[COMBO_SAL_BACK_BANK.options.valueField] == defaultItems[i]) {
                            return true;
                        }
                    };
                };
                return false;
            },
            onAfterShowData: function (currentData) {
                if(!isInit_setSearchComboVal5) { //只在初始化时执行一次，在onAfterShowData后改变
                    COMBO_SAL_BACK_BANK.setInputValue(comboGrid_defaultValue5, comboGrid_defaultText5, true);
                    isInit_setSearchComboVal5 = true;
                }
            }
        };
        return options;
    }


	//供应商厂商信息
	function getSplMfrInfo(){
		var splId =liger.get("splId").selectedValue;
        if(splId==undefined||splId==''){
            return;
        }
        audStsCdList.push(CommonConstant.C_AUD_PASS_CODE);
        var audStsCdListArr = JSON.stringify(audStsCdList);
        var splMfrId='${splMfrId}';
        $.ajax({
            url: '<%=path%>/project/prjprdbscinfo/getSplMfrBySplId.do?splId='+splId+'&audStsCdList='+audStsCdListArr,
            dataType:'json',
            success: function (res) {
                var prjPrdSplMfrId = liger.get('splMfrId');
				if (prjPrdSplMfrId != null && prjPrdSplMfrId != '' && prjPrdSplMfrId != 'undefined') {
					prjPrdSplMfrId.gridManager.loadData(res);
					// prjPrdSplMfrId.clear();
					if (splMfrId) {
						prjPrdSplMfrId.setValue(splMfrId);
					}
				}
            }
        });
    }
    var comboGrid_defaultValue4='${splMfrId}';
    var comboGrid_defaultText4 = '${splMfrNm}';
    var isInit_setSearchComboVal4 = false;
    var COMBO_SPL_MFR = $("#splMfrId").ligerComboBox({
        width: 400,
        selectBoxWidth: 400,
        selectBoxHeight: 240,
        valueField: 'id',
        textField: 'mfrName',
        isMultiSelect: true,
        isSingleCheck: true,
        grid: getSplMfrGridOptions(true),
        delayLoadGrid: false
    });

    // 初始化供应商厂商下拉列表
    function getSplMfrGridOptions(checkbox){
        var splId =liger.get("splId").selectedValue;
        var options = {
            columns: [
                { display: 'id', name: 'id', minWidth: 100,hide:true },
                { display: '厂商名称', name: 'mfrName', minWidth: 300 },

            ],
            switchPageSizeApplyComboBox: false,
            method: 'get',
            data:null,
            dataAction: 'local',
            root:'rows',
            record:'total',
            pageSize: 10,
            usePagerOnLessPagesize: false,
            cssClass: "SMALL_grid",
            // checkbox: checkbox,
            isSingleCheck: true,
            frozen: false,
            isSelected: function (rowdata) {
                if (comboGrid_defaultValue4 == "") return false;
                var defaultItems = comboGrid_defaultValue4.split(";");
                if(!isInit_setSearchComboVal4) { //只在初始化时执行一次，在onAfterShowData后改变
                    for (var i = 0; i < defaultItems.length; i++) {
                        if(rowdata[COMBO_SPL_MFR.options.valueField] == defaultItems[i]) {
                            return true;
                        }
                    };
                };
                return false;
            },
            onAfterShowData: function (currentData) {
                if(!isInit_setSearchComboVal4) { //只在初始化时执行一次，在onAfterShowData后改变
                    COMBO_SPL_MFR.setInputValue(comboGrid_defaultValue4, comboGrid_defaultText4, true);
                    isInit_setSearchComboVal4 = true;
                }
            }
        };
        return options;
    }




    function setSplBackBankShow(){
        var isBckNo = $("#isBckNo").val();
        if(isBckNo=='1'){
            $("#splBckBankAccDiv").show();
        }
        if(isBckNo=='0'){
            $("#splBckBankAccDiv").hide();
            //设置值为空
            $("#splBackBankNoId").val("");
        }
    }
    function setSalBackBankShow(){
        var isSalBckNo = $("#isSalBckNo").val();
        if(isSalBckNo=='1'){
            $("#salBckBankAccDiv").show();
            $("#msgDiv").show();

        }
        if(isSalBckNo=='0'){
            $("#salBckBankAccDiv").hide();
            $("#msgDiv").hide();

            $("#salBackBankNoId").val("");
        }
    }

	function getSplAccNos(){
		/*COMBO_BANK.setInputValue(null,null,true);
		COMPENSATORY_COMBO_BANK.setInputValue(null,null,true);*/
		getSplBankNo();
		if (prjTypCd != 'CDDYWYQ') {
			getSplBackBankNo();
			getSalBackBankNo();
		}
		getSplMfrInfo();
		if(liger.get('splAccNoId') && liger.get('splAccNoId').grid.rows.length>0){
			liger.get('splAccNoId').clear();
		}
		COMBO_BANK.setInputValue(null,null,true);
	}

	function getGuaranteePaymentInfo(value){
		getGuaranteeChannelInfo(value);
		if(liger.get('guaranteePaymentId') && liger.get('guaranteePaymentId').grid.rows.length>0){
			liger.get('guaranteePaymentId').clear();
		}
		GUARANEEPAYMENT_CHANNEL_INFO.setInputValue(null,null,true);
		if(compensatoryType == '1'){
			//getCompensatorySplBankNo();
			clearCompensatorySplAccInfo();
			setTimeout(function () {
			},1000);
			COMPENSATORY_COMBO_BANK.setInputValue(null,null,true);
		}
		if(compensatoryType == '2'){
			//getDepositSplBankNo();
			clearDepositSplAccInfo();
			setTimeout(function () {
			},1000);
			DEPOSIT_COMBO_BANK.setInputValue(null,null,true);
		}
	}

	function clearCompensatorySplAccInfo(){
		if(liger.get('compensatorySplAccNoId') && liger.get('compensatorySplAccNoId').grid.rows.length>0){
			liger.get('compensatorySplAccNoId').clear();
		}
		if(liger.get('compensatorySplRcptUnt')){
			liger.get('compensatorySplRcptUnt').setValue("");
		}
		if(liger.get('compensatorySplBkNm')){
			liger.get('compensatorySplBkNm').setValue("");
		}
		if(liger.get('compensatorySplBkNo')){
			liger.get('compensatorySplBkNo').setValue("");
		}
	}

	function clearDepositSplAccInfo(){
		if(liger.get('depositSplAccNoId') && liger.get('depositSplAccNoId').grid.rows.length>0){
			liger.get('depositSplAccNoId').clear();
		}
		if(liger.get('depositSplRcptUnt')){
			liger.get('depositSplRcptUnt').setValue("");
		}
		if(liger.get('depositSplBkNm')){
			liger.get('depositSplBkNm').setValue("");
		}
		if(liger.get('depositSplBkNo')){
			liger.get('depositSplBkNo').setValue("");
		}
	}

	function getGuaranteeAccNoInfo(){
		if(compensatoryType == '1'){
			getCompensatorySplBankNo();
			clearCompensatorySplAccInfo();
			COMPENSATORY_COMBO_BANK.setInputValue(null,null,true);
		}
		if(compensatoryType == '2'){
			getDepositSplBankNo();
			clearDepositSplAccInfo();
			DEPOSIT_COMBO_BANK.setInputValue(null,null,true);
		}
	}

	function getCompensatorySplAccNos(){
		COMPENSATORY_COMBO_BANK.setInputValue(null,null,true);
		getCompensatorySplBankNo();
		if(liger.get('compensatorySplAccNoId') && liger.get('compensatorySplAccNoId').grid.rows.length>0){
			liger.get('compensatorySplAccNoId').clear();
		}
	}
	function getCstSplAccNos(){
		getCstSplBankNo();
		getSalBackBankNo();
	}
	// 初始化厂商下拉
	function initMfrComboBox(){
		$("#mfr").ligerComboBox(
				{
					url: '<%=path%>/product/mfrInfo/searchList.do',
					valueField: 'id',
					textField: 'mfrNm',
					selectBoxWidth: 200,
					autocomplete: function (e){
						filter_autoComboboxData(e.key, this);
						e.show();
					},keySupport:true,onChangeValue:function(value){
						var mfrId = liger.get("mfr").getValue();
						$("#mfrId").val(mfrId);
						$("#mfrNm").val(value);
					},
					width: 200
				}
		);
	}

	//承租人、担保人列表
	var comboGrid_defaultValue6='${splId}';
	var comboGrid_defaultText6 = '${splNm}';
	var isInit_setSearchComboVal6 = false;
	var COMBO_CST = $("#cstSplId").ligerComboBox({
		width: 300,
		selectBoxWidth: 300,
		selectBoxHeight: 240,
		valueField: 'cstId',
		textField: 'cstNm',
		isMultiSelect: true,
		isSingleCheck: true,
		grid: getCstSplGridOptions(),
		delayLoadGrid: false,
		onChangeValue: function (value) {
			if (COMBO_CST) {
				if (value=="") comboGrid_defaultValue6 = ""; //如果点击清空'x'，就滞空初始值
				$("#cstSplId").show_ligerComboItems(".combo_itemList_wrap");
			};
			//获取前置客户ID
			var _prjId = '${prjId}';
            var receiveTypeCd = $("#receiveTypeCd").val();
			if(receiveTypeCd == ProjectConstant.RECEIVE_TYPE_CD_CZR || receiveTypeCd == ProjectConstant.RECEIVE_TYPE_CD_DBR){
                $.ajax({
                    type: 'post',
                    dataType:'json',
                    data:{prjId:_prjId},
                    url: '<%=path%>/project/prjcstbscInfo/searchRcCstBscInfoByCstMgr.do?prjId=' + _prjId,
                    success:function(msg){
                        if(msg.success == 1){
                            _rcCstBscInfoId = msg.data;
                        }else{
                            top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                        }
                    }
                });
            }
			SetIframe_height();
			if(liger.get('cstSplAccNoId') && liger.get('cstSplAccNoId').grid.rows.length>0){
				liger.get('cstSplAccNoId').clear();
			}
		}
	});

	function getCstSplGridOptions(){
		var receiveTypeCd = $("#receiveTypeCd").val();
		if(receiveTypeCd == ''){
			$.ligerDialog.error("收款方类型不能为空");
			return false;
		}
		var cstRlTyp =  '';
		if(receiveTypeCd == ProjectConstant.RECEIVE_TYPE_CD_CZR){
			cstRlTyp = 1
		}else if(receiveTypeCd == ProjectConstant.RECEIVE_TYPE_CD_DBR){
			cstRlTyp = 2
		}
		var _prjId = '${prjId}';
		var options = {
			columns: [
				{display: "客户名称", name: 'cstNm', minWidth: 100},
				{display: '证件/组织机构代码', name: 'certNo', minWidth: 200}
			],
			switchPageSizeApplyComboBox: false,
			url: '<%=path%>/project/prjcstbscInfo/initList.do' ,
			method: 'get',
			dataAction: 'local',
			root:'rows',
			record:'total',
			pageSize: 10,
			usePagerOnLessPagesize: false,
			cssClass: "SMALL_grid",
			isSingleCheck: true,
			frozen: false,
			isSelected: function (rowdata) {
				if (comboGrid_defaultValue6 == "") return false;
				if(!isInit_setSearchComboVal6) { //只在初始化时执行一次，在onAfterShowData后改变
					if(rowdata[COMBO_CST.options.valueField] == comboGrid_defaultValue6) {
						return true;
					}
				};
				return false;
			},
			onAfterShowData: function (currentData) {
				if(!isInit_setSearchComboVal6) { //只在初始化时执行一次，在onAfterShowData后改变
					COMBO_CST.setInputValue(comboGrid_defaultValue6, comboGrid_defaultText6, true);
					COMBO_CST_BANK.setInputValue(comboGrid_defaultValue7, comboGrid_defaultText7, true);
					isInit_setSearchComboVal6 = true;
				}
			}
		};
		return options;
	}

	//承租人、担保人账号列表
	var comboGrid_defaultValue7='${accId}';
	var comboGrid_defaultText7 = '${accNo}';
	var isInit_setSearchComboVal7 = true;
	var COMBO_CST_BANK=$("#cstSplAccNoId").ligerComboBox({
		width: 300,
		selectBoxWidth: 430,
		selectBoxHeight: 240,
		valueField: 'id',
		textField: 'accNo',
		isSingleCheck: true,
		grid: getCstSplBankNoGridOptions(),
		delayLoadGrid: false
	});

	// 获取供应商账号的列表
	function getCstSplBankNoGridOptions(){
		var options = {
			url: '<%=path%>/customer/cstbank/initBanks.do',
			columns: [
				{ display: 'id', name: 'id', minWidth: 150,hide:true },
				{ display: '账户名称', name: 'accNm',
					render: function (rowdata, rowindex, value, column) {
						value ==null?"":value;
						var h = '';
						if(rowdata.audStsCd){
							if(rowdata.audStsCd!='1'){
								h+='<i class="ico_flasher"></i>';
							}
						}
						h+=value;
						return h;
					},
					minWidth: 150 },
				{ display: '对公/对私', name: 'accTypCdNm', minWidth: 50, width: 60 },
				{ display: '收款账号', name: 'accNo', minWidth: 150 },
				{ display: '开户银行', name: 'bkNm', minWidth: 150 },
				{ display: '开户行号', name: 'bkNo', minWidth: 50 }

			],
			method: 'get',
			data:null,
			dataAction: 'server',
			root:'rows',
			record:'total',
			pageSize: 10,
			cssClass: "SMALL_grid",
			isSingleCheck: true,
			frozen: false,
			isSelected: function (rowdata) {
				if (comboGrid_defaultValue7 == "") return false;
				if(!isInit_setSearchComboVal7) { //只在初始化时执行一次，在onAfterShowData后改变
					if(rowdata[COMBO_CST_BANK.options.valueField] == comboGrid_defaultValue7) {
						return true;
					}
				};
				return false;
			},
			onAfterShowData: function (currentData) {
				if(!isInit_setSearchComboVal7) { //只在初始化时执行一次，在onAfterShowData后改变
					COMBO_CST_BANK.setInputValue(comboGrid_defaultValue7, comboGrid_defaultText7, true);
					isInit_setSearchComboVal7 = true;
				}
			}
		};
		return options;
	}
	function getCstInfoList(){
		var receiveTypeCd = $("#receiveTypeCd").val();
		if(receiveTypeCd == ''){
			$.ligerDialog.error("收款方类型不能为空");
			return false;
		}
		var cstRlTyp =  '';
		if(receiveTypeCd == ProjectConstant.RECEIVE_TYPE_CD_CZR){
			cstRlTyp = 1
		}else if(receiveTypeCd == ProjectConstant.RECEIVE_TYPE_CD_DBR){
			cstRlTyp = 2
		}
		if (prjTypCd == 'CDDYWYQ') {
			cstRlTyp = 1;
		}
		COMBO_CST.grid.loadServerData({"prjId":'${prjId}',"cstRlTyp":cstRlTyp});
	}
	function getCstBankInfoList(){
		COMBO_CST_BANK.grid.loadServerData({"cstId":liger.get("cstSplId").selectedValue});
	}
	function getCstSplBankNo(){
		COMBO_CST_BANK.setInputValue(comboGrid_defaultValue7, comboGrid_defaultText7, true);
	}

    function saveEscInfoBtn(){
        var ligerForm = liger.get("basePrdForm1");
        if (!ligerForm.valid()) {
            top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }
        var data = ligerForm.getData();
        var id = '${id}';
        data["id"] = id;
        data["certDt"] = $("#certDt").val();
        data["vehCheckCode"]=$("#vehCheckCode").val();
        var url = '<%=path%>/project/prjprdbscinfo/modify.do';
        var wait_dialog;
        $.ajax({
            type: 'post',
            dataType:'json',
            data:data,
            url: url,
            beforeSend: function(){
                wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
            },
            success:function(msg){
                wait_dialog.close();
                if(msg.success == 1){
                    $.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
                }else{
                    $.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
                }
            }
        });
	}

	function syncSourceDateInfo() {
		var ligerForm = liger.get("basePrdForm1");
		if (!ligerForm.valid()) {
			top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
			return false; //验证不通过，不执行以下代码
		}
		var data = ligerForm.getData();
		data["prjId"] = prjId;
		data["prdbscInfoId"] = $("#prdbscInfoId").val();
		var url = '<%=path%>/project/vehicle/addPrdCarSourceDetail.do';
		var wait_dialog;
		$.ajax({
			type: 'post',
			dataType:'json',
			data:data,
			url: url,
			beforeSend: function(){
				wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
			},
			success:function(msg){
				if(msg.success == 1){
					wait_dialog.close();
					top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
					var TAB=top.mainApp.parentTab;
					var currentTabid=TAB.getSelectedTabItemID();
					TAB.reload(currentTabid);
					var currFrameElement=top.$("#"+currentTabid).get(0);
					var callback=currFrameElement.W2W.callback;
					callback();
					top.tab.removeTabItem(currentTabid);
				}else{
					wait_dialog.close();
					UIUtils.alertError(msg.info);
				}
			}
		});
    }

    function toPdfFilepath(){
        var pdfFilepath = '${pdfFilepath}';
        if (!pdfFilepath){
            $.ligerDialog.SQalert({content: "获取车辆评估检测报告失败啦！", SQ_type: "error"});
        };
    }

    //保存车辆估值
	function saveVehVal(){
		var ligerForm = liger.get("basePrdForm1");
		if (!ligerForm.valid()) {
			top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
			return false; //验证不通过，不执行以下代码
		}
		var data = ligerForm.getData();
		var id = '${id}';
		data["id"] = id;
		data["vehVal"] = $("#vehVal").val();
		var url = '<%=path%>/project/prjprdbscinfo/modify.do';
		var wait_dialog;
		$.ajax({
			type: 'post',
			dataType:'json',
			data:data,
			url: url,
			beforeSend: function(){
				wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
			},
			success:function(msg){
				wait_dialog.close();
				if(msg.success == 1){
					$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
				}else{
					$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
				}
			}
		});
	}

	//添加挂靠公司
	function selectLnkComp(){
		var callback = function(){
			grid.reload();
		}

		var _ids = "";
        /*
        var prjId = prjId;
        */
		var splId = $("#splId_val").val();
		console.log(splId);
		if(splId == ''){
			$.ligerDialog.SQalert({content: "请选择收款方！", SQ_type: "warring"});
			return;
		}
		var vehNo = vehNo;
		if(ProjectConstant.PRJ_TYP_CD_CDDYWUL == prjTypCd){
			if(StringUtils.isEmpty(vehNo)){
				$.ligerDialog.SQalert({content: "车牌号不能为空", SQ_type: "warring"});
				return;
			}
		}
		//var ids =	JSON.stringify(_ids);
		$.ligerDialog.open({  title: '添加产品挂靠公司',height: 500,width: 850, url:'<%=path%>/project/prjprddtl/toChooseLnkCompPage.do?prjId='+prjId+'&vehNo='+vehNo+'&splId='+splId,callback:callback});
	}

	$('input[type=radio][name=lnkCompType]').change(function() {
		//console.log($('input[type=radio][name=lnkCompType]').val());
		console.log($('input:radio[name="lnkCompType"]:checked').val());
		if ($('input:radio[name="lnkCompType"]:checked').val() == '2') {
			$("#lnkCompNm").val('');
			$('#lnkCompNm').attr("disabled",true);
			$("#lnkCompId").val('');
			$("#lnkCompMsg").val('');
			$("#lnkStartLvl").val('');
		}else{
			$('#lnkCompNm').attr("disabled",false);
		}
	});

	console.log(compensatoryType + 'compensatoryType');

	if (compensatoryType == '1') {
		getCompensatorySplBankNo();
		$('#compensatorySplInfo').show();
		$('#compensatorySplRcptUnt').val('${compensatorySplRcptUnt}');
		$('#compensatorySplBkNm').val('${compensatorySplBkNm}');
		$('#compensatorySplBkNo').val('${compensatorySplBkNo}');
	}

	if (compensatoryType == '2') {
		getDepositSplBankNo();
		$('#depositSplInfo').show();
		$('#depositSplRcptUnt').val('${depositSplRcptUnt}');
		$('#depositSplBkNm').val('${depositSplBkNm}');
		$('#depositSplBkNo').val('${depositSplBkNo}');
	}
</script>
<div class="ClearLine"></div>
</body>
</html>
